Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

window name "ericFoo##" already exists in parent

422 views
Skip to first unread message

Philip Newton

unread,
Feb 24, 2004, 10:39:02 AM2/24/04
to
I'm using ActiveTcl 8.3.4.2 on a PC running Windows and I'm trying to
paint some items inside a frame belonging to a larger application which
reads Tcl scripts.

I'd already succeeded painting some things involving only labels,
entrys, and buttons, but now I got shown a prototype that involved a
frame with a title and some buttons with left and right arrows on them.

I had a look around the help documentation and it seems that the
BWidgets widget set can help me with its TitleFrame and ArrowButton
widgets.

However, when I try to create such a widget, I get the error message

window name "ericFoo##" already exists in parent

as a return value from TitleFrame and ArrowButton.

Here's some sample code, with some (IMO) irrelevant lines snipped:

proc ::PersonAuswaehlen::showDialog {} {
global strUser
global curFrame

set curFrame $::analysis::wAnalysis.fGraph

set fKatalog [TitleFrame $curFrame.katalog -text "Personenkatalog"]
set fPersonen [TitleFrame $curFrame.personen -text "Beteiligte
Personen"]
set fButtons [frame $curFrame.buttons]

tk_messageBox -message "fKatalog = {$fKatalog}\nfPersonen =
{$fPersonen}\nfButtons = {$fButtons}"

set ButtonAdd [ArrowButton $fButtons.add -dir right \
-width 25 -height 25 -type button -ipadx 3 -ipady 3 \
-command {}]
set ButtonRemove [ArrowButton $fButtons.remove -dir left \
-width 25 -height 25 -type button -ipadx 3 -ipady 3 \
-command {}]

tk_messageBox -message "ButtonAdd = {$ButtonAdd}\nButtonRemove =
{$ButtonRemove}"


The BWidgets bits were cribbed from the file basic.tcl that comes with
the BWidgets demo, so I'm fairly confident they're fine. (NB the lines
are unwrapped in the original.)

The message box that comes up shows that $fKatalog and $fPersonen both
have the value {window name "ericFoo##" already exists in parent} while
$fButons has the value {.frameMain.fr.fGraph.buttons}, which looks more
sensible. The two Button variables also contain the error message.

Googling for "ericFoo##" doesn't seem to help -- it finds a few people
with username "ericfoo" and an HTMLisation of the BWidgets file
widget.tcl. Google Groups isn't particularly forthcoming, either.

Any ideas?

Cheers,
Philip
--
Philip Newton <Philip...@gedas.de>
My opinions are my own, not my employer's

Damon Courtney

unread,
Feb 24, 2004, 2:31:52 PM2/24/04
to
Philip Newton <Philip...@gedas.de> wrote in message news:<1tqm309dmcarofcqj...@4ax.com>...

> I'm using ActiveTcl 8.3.4.2 on a PC running Windows and I'm trying to
> paint some items inside a frame belonging to a larger application which
> reads Tcl scripts.

This is an older version of Tcl, and it uses an older version of
BWidgets (1.5, if I recall). You might consider upgrading to either
the latest ActiveTcl release or just upgrading your BWidget library.
I ran your code against the BWidget version I have (1.7), and it seems
to work fine.

The ericFoo## window is just a scrap window used in BWidgets when
trying to initialize some widget stuff. I'm not sure why you're
seeing the error though.

Damon

Philip Newton

unread,
Feb 27, 2004, 4:57:49 AM2/27/04
to
On 24 Feb 2004 11:31:52 -0800, da...@unreality.com (Damon Courtney)
wrote:

> Philip Newton <Philip...@gedas.de> wrote in message
> news:<1tqm309dmcarofcqj...@4ax.com>...
> > I'm using ActiveTcl 8.3.4.2 on a PC running Windows and I'm trying
> > to paint some items inside a frame belonging to a larger
> > application which reads Tcl scripts.
>
> This is an older version of Tcl, and it uses an older version of
> BWidgets (1.5, if I recall).

1.4, as far as I can tell.

> You might consider upgrading to either the latest ActiveTcl release
> or just upgrading your BWidget library. I ran your code against the
> BWidget version I have (1.7), and it seems to work fine.

I downloaded and installed BWidget 1.7 into a directory BWidget-1.7.0
next to bwidget1.4.0 and explicitly loaded it with "package require
BWidget 1.5". Still no dice.

It works from a stand-alone wish session, so it may be something to do
with the app in which it's embedded or with missing cleanup.

> The ericFoo## window is just a scrap window used in BWidgets
> when trying to initialize some widget stuff. I'm not sure why
> you're seeing the error though.

I've seen something interesting now, though - when I run the script
the *first* time, I get a different error message on invoking
TitleFrame: {unknown option "-state"}.

When I re-load the script, I start getting {window name "ericFoo##"
already exists in parent} instead.

So maybe the problem is that some internal state isn't getting cleaned
up?

I'm not sure why I get the error message {unknown option "-state"} the
first time around, though. widget.tcl only contains this string once,
inside a catch; titleframe.tcl has it twice, though, and apparently
refers to the label subwidget -- but the HTMLHelp docs for ActiveTcl
say that label *does* have an option -state.

So I'm confused. Help?

lvi...@yahoo.com

unread,
Feb 27, 2004, 7:34:32 AM2/27/04
to

According to Philip Newton <Philip...@gedas.de>:
:I've seen something interesting now, though - when I run the script

:the *first* time, I get a different error message on invoking
:TitleFrame: {unknown option "-state"}.
:
:When I re-load the script, I start getting {window name "ericFoo##"
:already exists in parent} instead.
:
:So maybe the problem is that some internal state isn't getting cleaned
:up?

Sounds like not all the objects created during the first time load are
deleted. Take a look at tcl's info command and get a dump of
the variables, procs, etc. created before you load the script the first
time, after you load the script the first time, and see what's around.
Perhaps that will help you track down the issue.

--
<URL: http://wiki.tcl.tk/ > In God we trust.
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvi...@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >

Philip Newton

unread,
Mar 1, 2004, 5:43:49 AM3/1/04
to
On 27 Feb 2004 12:34:32 GMT, lvi...@yahoo.com wrote:

>
> According to Philip Newton <Philip...@gedas.de>:
> :I've seen something interesting now, though - when I run the script
> :the *first* time, I get a different error message on invoking
> :TitleFrame: {unknown option "-state"}.
> :
> :When I re-load the script, I start getting {window name "ericFoo##"
> :already exists in parent} instead.
> :
> :So maybe the problem is that some internal state isn't getting cleaned
> :up?
>
> Sounds like not all the objects created during the first time load are
> deleted. Take a look at tcl's info command and get a dump of
> the variables, procs, etc. created before you load the script the first
> time, after you load the script the first time, and see what's around.
> Perhaps that will help you track down the issue.

OK, sounds like something to try.

But that still leaves the {unknown option "-state"} error message that
comes along the first time around.

Cheers,
Philip
--
Philip Newton <nospam...@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.

lvi...@yahoo.com

unread,
Mar 1, 2004, 7:50:07 AM3/1/04
to

According to Philip Newton <nospam...@gmx.li>:
:> According to Philip Newton <Philip...@gedas.de>:

:> :I've seen something interesting now, though - when I run the script
:> :the *first* time, I get a different error message on invoking
:> :TitleFrame: {unknown option "-state"}.

:But that still leaves the {unknown option "-state"} error message that


:comes along the first time around.


Well, can you provide us more detail? For instance, can you show us a
small example of tcl code that invokes the titleframe that generates
the error?

My first thought is that something in your enviroment is setting some
kind of option for one of the widgets in titleframe in a strange way -
perhaps with some non-printing characters that leave you reading a msg
that seems like it is saying the impossible.

Neil McKay

unread,
Mar 1, 2004, 2:37:13 PM3/1/04
to

According to Philip Newton <nospam...@gmx.li>:
:> According to Philip Newton <Philip...@gedas.de>:
:> :I've seen something interesting now, though - when I run the script
:> :the *first* time, I get a different error message on invoking
:> :TitleFrame: {unknown option "-state"}.

:But that still leaves the {unknown option "-state"} error message that
:comes along the first time around.

You can get this error if you have a script whose name is the same
as a standard Tk widget. For example, put the following script in a
file called "button":

#!/path/to/wish

label .l -text "Foo"
grid .l


This gives a stack trace with the {unknown option "-state"}
error message. Because Tk gives the root window a class based on
its script name, "." has class "Button", and tries to use
options associated with a button. This, of course, does NOT
work with toplevel widgets.

Neil McKay

0 new messages