f



BWidget tree can't be "packed" in latest tcl/tk (8.6.b1.1)

With windows (2k/xp) and 8.6b1 tcl/tk in a tclkit my code works. I
just found a newer tclkit, 8.6b1.1 and the below test code is now
suddenly broken. It gets an error on the second pack statement:

"cannot use geometry manager pack inside .wtree_top.sw which already
has slaves managed by grid"

Is there a new restriction (or one that is now enforced) that has
recently been added that causes this to break?

It would be a rather sad development if I could no longer use BWidget
trees with the pack manager.



--------------------------------------


I built my own tclkit (tst.exe) on windows with BWidgets 1.9 or 1.8
using this build statement having downloaded a recent tclkit.

tclkit sdx.kit wrap tst.exe -runtime tclkit-gui-86b1-1.exe

I've also verified this code works under my active state's 8.4
installed tcl/tk which uses BWidgets 1.6



proc test {} {
	set top .wtree_top
	package require BWidget

	toplevel $top
	ScrolledWindow $top.sw
	pack $top.sw -fill both -expand 1 -side top
	Tree $top.sw.t  -deltay 25 -deltax 25 -padx 5 \
           -borderwidth 8 -linesfill orange -padx 5
	pack $top.sw.t
	$top.sw setwidget $top.sw.t
	$top.sw.t insert end root 1 -text {item one}
	$top.sw.t insert end 1    2 -text {item two}
	$top.sw.t insert end 1    3 -text {item three}
	$top.sw.t insert end 1    4 -text {item four}
	$top.sw.t insert end 1    5 -text {item five}
}
test
0
5/17/2010 7:48:37 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

3 Replies
830 Views

Similar Articles

[PageSpeed] 29

Hi,

there is only a "bug" inside your code.

You don't have to "manage" the tree widget explicitely!

The ScrolledWindow widget is already managing the Tree widget after
calling "setwidget"!

So - here the working test code again ...

    proc test {} {
        package require BWidget
        set top .wtree_top

        toplevel $top
            ScrolledWindow $top.sw
                Tree $top.sw.t  -deltay 25 -deltax 25 -padx 5 -
borderwidth 8 -linesfill orange -padx 5
            $top.sw setwidget $top.sw.t
        pack $top.sw -fill both -expand 1 -side top

        $top.sw.t insert end root 1 -text {item one}
        $top.sw.t insert end 1    2 -text {item two}
        $top.sw.t insert end 1    3 -text {item three}
        $top.sw.t insert end 1    4 -text {item four}
        $top.sw.t insert end 1    5 -text {item five}
    }

    test

Best regards,

Martin

On 17 Mai, 21:48, rocket777 <googlegro...@rocketship1.biz> wrote:
> With windows (2k/xp) and 8.6b1 tcl/tk in a tclkit my code works. I
> just found a newer tclkit, 8.6b1.1 and the below test code is now
> suddenly broken. It gets an error on the second pack statement:
>
> "cannot use geometry manager pack inside .wtree_top.sw which already
> has slaves managed by grid"
>
> Is there a new restriction (or one that is now enforced) that has
> recently been added that causes this to break?
>
> It would be a rather sad development if I could no longer use BWidget
> trees with the pack manager.
>
> --------------------------------------
>
> I built my own tclkit (tst.exe) on windows with BWidgets 1.9 or 1.8
> using this build statement having downloaded a recent tclkit.
>
> tclkit sdx.kit wrap tst.exe -runtime tclkit-gui-86b1-1.exe
>
> I've also verified this code works under my active state's 8.4
> installed tcl/tk which uses BWidgets 1.6
>
> proc test {} {
> =A0 =A0 =A0 =A0 set top .wtree_top
> =A0 =A0 =A0 =A0 package require BWidget
>
> =A0 =A0 =A0 =A0 toplevel $top
> =A0 =A0 =A0 =A0 ScrolledWindow $top.sw
> =A0 =A0 =A0 =A0 pack $top.sw -fill both -expand 1 -side top
> =A0 =A0 =A0 =A0 Tree $top.sw.t =A0-deltay 25 -deltax 25 -padx 5 \
> =A0 =A0 =A0 =A0 =A0 =A0-borderwidth 8 -linesfill orange -padx 5
> =A0 =A0 =A0 =A0 pack $top.sw.t
> =A0 =A0 =A0 =A0 $top.sw setwidget $top.sw.t
> =A0 =A0 =A0 =A0 $top.sw.t insert end root 1 -text {item one}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A02 -text {item two}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A03 -text {item three}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A04 -text {item four}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A05 -text {item five}}
>
> test

0
MartinLemburg
5/18/2010 7:01:32 AM
Ahhh ..... Such are the difficulties with copy/paste code that one
does not truly understand. But I now understand what it means in
setwidget when it says don't manage the widget yourself. And I now
also have a correct template to use in the future.

thanks



On May 18, 12:01=A0am, "MartinLemburg@Siemens-PLM"
<martin.lemburg.siemens-...@gmx.net> wrote:
> Hi,
>
> there is only a "bug" inside your code.
>
> You don't have to "manage" the tree widget explicitely!
>
> The ScrolledWindow widget is already managing the Tree widget after
> calling "setwidget"!
>
> So - here the working test code again ...
>
> =A0 =A0 proc test {} {
> =A0 =A0 =A0 =A0 package require BWidget
> =A0 =A0 =A0 =A0 set top .wtree_top
>
> =A0 =A0 =A0 =A0 toplevel $top
> =A0 =A0 =A0 =A0 =A0 =A0 ScrolledWindow $top.sw
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Tree $top.sw.t =A0-deltay 25 -deltax 25 -=
padx 5 -
> borderwidth 8 -linesfill orange -padx 5
> =A0 =A0 =A0 =A0 =A0 =A0 $top.sw setwidget $top.sw.t
> =A0 =A0 =A0 =A0 pack $top.sw -fill both -expand 1 -side top
>
> =A0 =A0 =A0 =A0 $top.sw.t insert end root 1 -text {item one}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A02 -text {item two}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A03 -text {item three}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A04 -text {item four}
> =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A05 -text {item five}
> =A0 =A0 }
>
> =A0 =A0 test
>
> Best regards,
>
> Martin
>
> On 17 Mai, 21:48, rocket777 <googlegro...@rocketship1.biz> wrote:
>
> > With windows (2k/xp) and 8.6b1 tcl/tk in a tclkit my code works. I
> > just found a newer tclkit, 8.6b1.1 and the below test code is now
> > suddenly broken. It gets an error on the second pack statement:
>
> > "cannot use geometry manager pack inside .wtree_top.sw which already
> > has slaves managed by grid"
>
> > Is there a new restriction (or one that is now enforced) that has
> > recently been added that causes this to break?
>
> > It would be a rather sad development if I could no longer use BWidget
> > trees with the pack manager.
>
> > --------------------------------------
>
> > I built my own tclkit (tst.exe) on windows with BWidgets 1.9 or 1.8
> > using this build statement having downloaded a recent tclkit.
>
> > tclkit sdx.kit wrap tst.exe -runtime tclkit-gui-86b1-1.exe
>
> > I've also verified this code works under my active state's 8.4
> > installed tcl/tk which uses BWidgets 1.6
>
> > proc test {} {
> > =A0 =A0 =A0 =A0 set top .wtree_top
> > =A0 =A0 =A0 =A0 package require BWidget
>
> > =A0 =A0 =A0 =A0 toplevel $top
> > =A0 =A0 =A0 =A0 ScrolledWindow $top.sw
> > =A0 =A0 =A0 =A0 pack $top.sw -fill both -expand 1 -side top
> > =A0 =A0 =A0 =A0 Tree $top.sw.t =A0-deltay 25 -deltax 25 -padx 5 \
> > =A0 =A0 =A0 =A0 =A0 =A0-borderwidth 8 -linesfill orange -padx 5
> > =A0 =A0 =A0 =A0 pack $top.sw.t
> > =A0 =A0 =A0 =A0 $top.sw setwidget $top.sw.t
> > =A0 =A0 =A0 =A0 $top.sw.t insert end root 1 -text {item one}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A02 -text {item two}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A03 -text {item three}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A04 -text {item four}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A05 -text {item five}}
>
> > test
>
>

0
rocket777
5/18/2010 9:51:56 PM
On May 18, 11:51=A0pm, rocket777 <googlegro...@rocketship1.biz> wrote:
> Ahhh ..... Such are the difficulties with copy/paste code that one
> does not truly understand. But I now understand what it means in
> setwidget when it says don't manage the widget yourself. And I now
> also have a correct template to use in the future.
>
> thanks
>
> On May 18, 12:01=A0am, "MartinLemburg@Siemens-PLM"
>
> <martin.lemburg.siemens-...@gmx.net> wrote:
> > Hi,
>
> > there is only a "bug" inside your code.
>
> > You don't have to "manage" the tree widget explicitely!
>
> > The ScrolledWindow widget is already managing the Tree widget after
> > calling "setwidget"!
>
> > So - here the working test code again ...
>
> > =A0 =A0 proc test {} {
> > =A0 =A0 =A0 =A0 package require BWidget
> > =A0 =A0 =A0 =A0 set top .wtree_top
>
> > =A0 =A0 =A0 =A0 toplevel $top
> > =A0 =A0 =A0 =A0 =A0 =A0 ScrolledWindow $top.sw
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Tree $top.sw.t =A0-deltay 25 -deltax 25=
 -padx 5 -
> > borderwidth 8 -linesfill orange -padx 5
> > =A0 =A0 =A0 =A0 =A0 =A0 $top.sw setwidget $top.sw.t
> > =A0 =A0 =A0 =A0 pack $top.sw -fill both -expand 1 -side top
>
> > =A0 =A0 =A0 =A0 $top.sw.t insert end root 1 -text {item one}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A02 -text {item two}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A03 -text {item three}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A04 -text {item four}
> > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A05 -text {item five}
> > =A0 =A0 }
>
> > =A0 =A0 test
>
> > Best regards,
>
> > Martin
>
> > On 17 Mai, 21:48, rocket777 <googlegro...@rocketship1.biz> wrote:
>
> > > With windows (2k/xp) and 8.6b1 tcl/tk in a tclkit my code works. I
> > > just found a newer tclkit, 8.6b1.1 and the below test code is now
> > > suddenly broken. It gets an error on the second pack statement:
>
> > > "cannot use geometry manager pack inside .wtree_top.sw which already
> > > has slaves managed by grid"
>
> > > Is there a new restriction (or one that is now enforced) that has
> > > recently been added that causes this to break?
>
> > > It would be a rather sad development if I could no longer use BWidget
> > > trees with the pack manager.
>
> > > --------------------------------------
>
> > > I built my own tclkit (tst.exe) on windows with BWidgets 1.9 or 1.8
> > > using this build statement having downloaded a recent tclkit.
>
> > > tclkit sdx.kit wrap tst.exe -runtime tclkit-gui-86b1-1.exe
>
> > > I've also verified this code works under my active state's 8.4
> > > installed tcl/tk which uses BWidgets 1.6
>
> > > proc test {} {
> > > =A0 =A0 =A0 =A0 set top .wtree_top
> > > =A0 =A0 =A0 =A0 package require BWidget
>
> > > =A0 =A0 =A0 =A0 toplevel $top
> > > =A0 =A0 =A0 =A0 ScrolledWindow $top.sw
> > > =A0 =A0 =A0 =A0 pack $top.sw -fill both -expand 1 -side top
> > > =A0 =A0 =A0 =A0 Tree $top.sw.t =A0-deltay 25 -deltax 25 -padx 5 \
> > > =A0 =A0 =A0 =A0 =A0 =A0-borderwidth 8 -linesfill orange -padx 5
> > > =A0 =A0 =A0 =A0 pack $top.sw.t
> > > =A0 =A0 =A0 =A0 $top.sw setwidget $top.sw.t
> > > =A0 =A0 =A0 =A0 $top.sw.t insert end root 1 -text {item one}
> > > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A02 -text {item two}
> > > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A03 -text {item three}
> > > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A04 -text {item four}
> > > =A0 =A0 =A0 =A0 $top.sw.t insert end 1 =A0 =A05 -text {item five}}
>
> > > test
>
>

What martin says is correct but curiously at some point in time
8.4.9 ? this worked. I have code which worked fine with this, when I
reused it it generated an endless loop which locks up the GUI, now it
seems it generates an error, this is much better.

Martyn
0
MSEdit
5/19/2010 10:36:52 AM
Reply: