Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Well known error "cannot use geometry manager pack inside ..."
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gerhard Reithofer  
View profile  
 More options Feb 12, 12:05 pm
Newsgroups: comp.lang.tcl
From: Gerhard Reithofer <gerhard.reitho...@tech-edv.co.at>
Date: Sun, 12 Feb 2012 18:05:46 +0100
Local: Sun, Feb 12 2012 12:05 pm
Subject: Well known error "cannot use geometry manager pack inside ..."
Hi,
I think that this topic has already been discussed and I'm afraid that
the behavior will not be changed in future versions (8.6x).

But I have now the problem, that long running code is affected.

My famous application where I was thrown back is the great editor ASED
(http://www.tcl-home.de/ased), but also several older self written
pragrams break.
Code which use pack inside grid does not fail dependable, only specific
situations end in an endless loop (I also reported such a failure many
years ago).
Even tcl tips have been refused for the sake of compatibility and a
complete turndown seems radical to me.

This refused the general upgrade to 8.6 in my projects.

I'd like to ask therefore for a migration possibility to avoid this
error - not to forget that some of my older apps, which are working for
years get this error.
Is "manual recoding" the only possibilty to circumevent this situation?

PS: Has someone ported ASED to 8.6 or ist someone working on that?

--
 Gerhard Reithofer
 Tech-EDV Support Forum - http://support.tech-edv.co.at


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Heller  
View profile  
 More options Feb 12, 3:07 pm
Newsgroups: comp.lang.tcl
From: Robert Heller <hel...@deepsoft.com>
Date: Sun, 12 Feb 2012 14:07:36 -0600
Local: Sun, Feb 12 2012 3:07 pm
Subject: Re: Well known error "cannot use geometry manager pack inside ..."
At Sun, 12 Feb 2012 18:05:46 +0100 Gerhard Reithofer <gerhard.reitho...@tech-edv.co.at> wrote:

It is a coding error to use more than one geometry manager in any given
container.  It *sounds* like what is happening here is something in the
*application* code is using both grid and pack to managing children of
a container.  It might be that some meta-widget extension has changed
and is now packing (or griding) its children and your code is also
packing/griding additional children, and your code is using the wrong
geometry manager OR is simply mis-using the meta-widget extension (eg
not using the meta-widget's code to pack/grid stuff in the
meta-widget's container or attempting to re-pack/re-grid children that
have already been grided/packed). All of these cases imply that there
are real live bugs in *your* application code and the problem is NOT a
problem with Tcl/Tk, other than maybe Tcl/Tk is now catching bugs it
failed to catch before.


--
Robert Heller             -- 978-544-6933 / hel...@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Schelte Bron  
View profile  
 More options Feb 12, 4:42 pm
Newsgroups: comp.lang.tcl
From: Schelte Bron <nos...@wanadoo.nl>
Date: Sun, 12 Feb 2012 22:42:47 +0100
Local: Sun, Feb 12 2012 4:42 pm
Subject: Re: Well known error "cannot use geometry manager pack inside ..."

Robert Heller wrote:
> It is a coding error to use more than one geometry manager in any
> given container.

This statement is false. There are definitly proper uses of more
than one geometry manager in a single container. For example, to
make a toplevel window that matches the ttk style I usually place a
ttk::frame in the toplevel and subsequently grid other widgets in
the toplevel. This works perfectly. And there is no reason why the
same thing couldn't be done with pack instead of place.

It is however a coding error to have two geometry managers dictate
the size of the master at the same time. But if you switch off
propagation for one of the managers, it is no problem to use both
pack and grid in the same container. So this works (even in Tk 8.6):

pack propagate . 0
pack [ttk::frame .bg] -fill both -expand 1
grid [ttk::label .l -text "Hello World"] -padx 20 -pady 20

Without seeing the code, the fact that the OP had some code in an
older Tk version that did not freeze the display suggests that this
is what the code was doing all along, but probaly not in that order.
Propagation only kicks in when the event loop is allowed to run. So
in the older Tk it was possible to first grid and pack widgets and
then turn off propagation. Tk 8.6 will produce the error mentioned
in the subject before the code gets to the statement that turns off
propagation.

If my understanding of the problem is correct, the simple fix will
be to find the [grid propagate 0] or [pack propagate 0] commands and
move them up a few lines.

Schelte.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Emiliano  
View profile  
 More options Feb 12, 4:55 pm
Newsgroups: comp.lang.tcl
From: Emiliano <emilianogavi...@gmail.com>
Date: Sun, 12 Feb 2012 13:55:57 -0800 (PST)
Local: Sun, Feb 12 2012 4:55 pm
Subject: Re: Well known error "cannot use geometry manager pack inside ..."
On 12 feb, 14:05, Gerhard Reithofer <gerhard.reitho...@tech-edv.co.at>
wrote:

> Hi,
> I think that this topic has already been discussed and I'm afraid that
> the behavior will not be changed in future versions (8.6x).

> But I have now the problem, that long running code is affected.

The affected code is buggy; please read on ...

> My famous application where I was thrown back is the great editor ASED
> (http://www.tcl-home.de/ased), but also several older self written
> pragrams break.

ASED can be fixed commenting out the two offending [pack]s.

> Code which use pack inside grid does not fail dependable, only specific
> situations end in an endless loop (I also reported such a failure many
> years ago).
> Even tcl tips have been refused for the sake of compatibility and a
> complete turndown seems radical to me.

> This refused the general upgrade to 8.6 in my projects.

> I'd like to ask therefore for a migration possibility to avoid this
> error - not to forget that some of my older apps, which are working for
> years get this error.
> Is "manual recoding" the only possibilty to circumevent this situation?

> PS: Has someone ported ASED to 8.6 or ist someone working on that?

Most affected code I've seen so far is due to a misuse of
Bwidget's ScrolledWindow. The code is supposed to create a child of
the
SW and use the setwidget method to map the managed window. But ASED
(and other software I've seen in the wild) also tries to [pack] the
child, which is a bug.

As stated above, ASED can be made to work commenting out the two
[pack]s
that breaks on 8.6.
There are other problems with the bundled tools (tkcon and tkdiff).
Both can be made to work by upgrading to their respective latest
versions.

Regards
Emiliano


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Uwe Klein  
View profile  
 More options Feb 13, 3:00 am
Newsgroups: comp.lang.tcl
From: Uwe Klein <u...@klein-habertwedt.de>
Date: Mon, 13 Feb 2012 09:00:35 +0100
Local: Mon, Feb 13 2012 3:00 am
Subject: Re: Well known error "cannot use geometry manager pack inside ..."

Schelte Bron wrote:
> Robert Heller wrote:

>>It is a coding error to use more than one geometry manager in any
>>given container.

> This statement is false. There are definitly proper uses of more
> than one geometry manager in a single container. For example, to
> make a toplevel window that matches the ttk style I usually place a
> ttk::frame in the toplevel and subsequently grid other widgets in
> the toplevel. This works perfectly. And there is no reason why the
> same thing couldn't be done with pack instead of place.

( haven't used ttk yet )
What visual effect does that achieve?

> It is however a coding error to have two geometry managers dictate
> the size of the master at the same time. But if you switch off
> propagation for one of the managers, ..

This is Entrapment ;-)
( and will "boil up" sooner or later imho )

uwe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gerhard Reithofer  
View profile  
 More options Feb 13, 1:01 pm
Newsgroups: comp.lang.tcl
From: Gerhard Reithofer <gerhard.reitho...@tech-edv.co.at>
Date: Mon, 13 Feb 2012 19:01:28 +0100
Local: Mon, Feb 13 2012 1:01 pm
Subject: Re: Well known error "cannot use geometry manager pack inside ..."
Hi Bron, hi all,

thanks, that's definitely new to me - exact explanation.

> Without seeing the code, the fact that the OP had some code in an
> older Tk version that did not freeze the display suggests that this
> is what the code was doing all along, but probaly not in that order.

That's right, also some old programs of mine are effected.

It's a fact, that mixing geometry managers sometimes work and sometime
the application freezes (depending on propagation . as you describe very
soundly).
Repairing the apps usually is also no big work - I've commented out the
2 lines in ASED - but my question was more about changed behaviors, if
it is not own code.

I.e. if you deliver a software with the described "bug".
If the customer upgrades his tcl version, the existing "well working"
program can't be run anymore!

If there would be an automatic check and/or repair solution, you could
give all users that tool to repair the software if affected.

At least one company I know has reduced tcl usage because of such a
problem.

[..]

Thank you for all you answers.

--
 Gerhard Reithofer
 Tech-EDV Support Forum - http://support.tech-edv.co.at


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Gollwitzer  
View profile  
 More options Feb 13, 4:23 pm
Newsgroups: comp.lang.tcl
From: Christian Gollwitzer <aurio...@gmx.de>
Date: Mon, 13 Feb 2012 22:23:02 +0100
Local: Mon, Feb 13 2012 4:23 pm
Subject: Re: Well known error "cannot use geometry manager pack inside ..."
Am 13.02.12 19:01, schrieb Gerhard Reithofer:

> I.e. if you deliver a software with the described "bug".
> If the customer upgrades his tcl version, the existing "well working"
> program can't be run anymore!

Well if the end user doesn't know he uses Tcl, he would be better off
with a packaged version aka starpack. Otherwise it's quite hard to
ensure stability.

> If there would be an automatic check and/or repair solution, you could
> give all users that tool to repair the software if affected.

> At least one company I know has reduced tcl usage because of such a
> problem.

this seems very strange to me. After all, Tcl is indeed quite
conservative. Compare that to Java...
That one - pack and grid together - was a long standing issue while
developping, and a corner case beforehand.

        Christian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »