#4 guibuilder -from and -to bug in spinbox

closed-fixed
nobody
None
5
2008-02-07
2007-12-10
Anonymous
No

Re: guibuilder
After creating a GUI app for Tcl/Tk, and adding a spinbox with specified -from and -to fields as 1 and 14 respectively, after saving, when the project is reopened there is an error generated about -to being less than -from.

If the .ui file is edited to remove the -to and -from properties, the project can be opened without error.

widget {Tk spinbox} _spinbox_1 {
configure -format %2.0f
configure -from 1
configure -textvariable channels
configure -to 14
configure -width 3
geometry -column 2
geometry -columnspan 1
geometry -row 2
geometry -rowspan 1
geometry -sticky {}
data GROUP Tk
data ID channels_spin
data MASTER {}
data TYPE {Tk spinbox}
}

James.

jamessteward@optusnet.com.au

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Patch that fixes this bug is attached.

    It basically catches the error while reading widget properties one-by-one and retries failed property again after all properties were read. It resolves any order dependency in properties, not just -from -to.

    Index: trunk/guib/src/save.tcl

    --- trunk/guib/src/save.tcl (revision 150)
    +++ trunk/guib/src/save.tcl (working copy)
    @@ -394,10 +394,19 @@
    eval [list ::widget::geometry $w] [array get geomDefs]
    }
    if {$first_widget eq ""} { set first_widget $w }
    + set redo_subs {}
    foreach sub [::compile::CmdSplit $subs] {
    # process the widget foo {... subcmds ...} data
    + set err [catch {
    load_project_string_widget $w $master $sub $clean
    + } res]
    + if {$err} {
    + lappend redo_subs $sub
    + }
    }
    + foreach sub $redo_subs {
    + load_project_string_widget $w $master $sub $clean
    + }
    lappend widgets $w
    } elseif {$wcmd eq "menu"} {
    if {!$clean} {

    ##END

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-02-07
    • status: open --> closed-fixed
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-02-07

    Logged In: YES
    user_id=72656
    Originator: NO

    Committed in svn rev 151.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks