2012-03-22 91 views
0

我是TK新手,我認爲我得到的錯誤信息是TK。以下是錯誤消息:TCL/TK錯誤消息沒有幫助。有些人可以幫助我,請

unknown option "-state"; must be one of -background, -bd, -bg, -borderwidth, -columnbd, -columnborderwidth, -columnrelief, -cursor, -exportselection, -fg, -fillcolumn, -font, -foreground, -height, -highlightbackground, -highlightcolor, -highlightthickness, -labelanchor, -labelbackground, -labelbd, -labelbg, -labelborderwidth, -labelfg, -labelfont, -labelforeground, -labelheight, -labelimage, -labelrelief, -labels, -relief, -resizablecolumns, -selectbackground, -selectborderwidth, -selectcommand, -selectforeground, -selectmode, -setgrid, -takefocus, -width, -xscrollcommand or -yscrollcommand

errorInfo中跟蹤:

unknown option "-state"; must be one of -background, -bd, -bg, -borderwidth, -columnbd, -columnborderwidth, -columnrelief, -cursor, -exportselection, -fg, -fillcolumn, -font, -foreground, -height, -highlightbackground, -highlightcolor, -highlightthickness, -labelanchor, -labelbackground, -labelbd, -labelbg, -labelborderwidth, -labelfg, -labelfont, -labelforeground, -labelheight, -labelimage, -labelrelief, -labels, -relief, -resizablecolumns, -selectbackground, -selectborderwidth, -selectcommand, -selectforeground, -selectmode, -setgrid, -takefocus, -width, -xscrollcommand or -yscrollcommand 
    while executing 
"::mclistbox::Canonize $w option [lindex $args 0]" 
    (procedure "::mclistbox::WidgetProc" line 211) 
    invoked from within 
"::mclistbox::WidgetProc .autoQuote.reportInfoTab.f.tit76.f.mcl84 cget -state" 
    ("eval" body line 1) 
    invoked from within 
"eval ::mclistbox::WidgetProc {.autoQuote.reportInfoTab.f.tit76.f.mcl84} $command $args" 
    (procedure ".autoQuote.reportInfoTab.f.tit76.f.mcl84" line 1) 
    invoked from within 
"$w cget -state" 
    (procedure "tk::ListboxBeginSelect" line 18) 
    invoked from within 
"tk::ListboxBeginSelect [::mclistbox::convert .autoQuote.reportInfoTab.f.tit76.f.mcl84.framecol1.listbox -W] [[::mclistbox::convert .autoQuote.reportIn..." 
    invoked from within 
"if {[winfo exists [::mclistbox::convert .autoQuote.reportInfoTab.f.tit76.f.mcl84.framecol1.listbox -W]]} { 
    tk::ListboxBeginSelect [::mclistbox::conve..." 
    (command bound to event) 

這不是我的代碼,但它看起來像它會在部件庫。我找到了例程'widgetProc',它似乎有一個'狀態'開關。我現在只是畫一片空白。

這裏是我的環境:

  • Windows 7企業版SP1。
  • TCL版本:8.5.11.1
  • bwidgets 1.95
  • 的iWidget 4.0.1
  • tcllib 1.14

回答

0

的錯誤不是由widgetProc引起的,而是由:: mclistbox :: Canonize。不幸的是,我並不熟悉它,但Google搜索快速顯示this的結果與解析度相似。然而,發佈日期會讓我樂觀地提出,如果可能的話,您可以升級到更新的版本。如果這是不可能的,也許你可以告訴我們你正在使用的代碼 - 也許有可能你調用它的方式觸發了錯誤。

+1

來源mclistbox是在http://tcllib.cvs.sourceforge.net/viewvc/tcllib/mclistbox/mclistbox.tcl?revision=1.34&view=markup – 2012-03-23 15:45:39

+0

而且,據我所見,應該有一個' -state'選項。嗯。 – 2012-03-23 15:50:22

+0

@DonalFellows謝謝!看起來OP還沒有回來,所以這個謎還會持續一段時間。 :-) – TrojanName 2012-03-23 17:08:27

0

我找到了一個快速的解決方法。不知道它是否完全正確,但它對我有效。 加入線下77(應爲「陣列組widgetOptions [列表\」)

-state  {State   State} \ 

將提供一個diff以下,但它是這樣一個簡單的修復,我不認爲它值得它。