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

TIP #125 Adding [wm toplevel] Subcommand

1 view
Skip to first unread message

Mark G. Saye

unread,
Aug 11, 2003, 12:59:13 PM8/11/03
to
I've recently been writing a toolbar widget, which got me thinking again
about TIP #125 ( http://www.tcl.tk/cgi-bin/tct/tip/125.html ), which
proposes adding a [wm toplevel] command to convert toplevel widgets into
frame widgets, and vice versa. It's not obvious from the main TIP site
how to make comments, so I thought I would post here, and then maybe on
the tcl-core mailing list.

Anyway, my thought was that it might be more logical to leverage the
existing toplevel -use option to enable 'tear-off' toplevels.

i.e. for toolbars (for example), create a dock container:

frame .dock -container 1

now create a toolbar using that dock:

toplevel .toolbar -use [winfo id .dock]

to 'tear-off' a docked toolbar into a transient window, you could do:

.toolbar configure -use ""
wm transient .toolbar .

and then back again:

wm transient .toolbar ""
.toolbar configure -use [winfo id .dock]

(maybe followed by a withdraw/deiconify cycle to activate changes)


This would make creating tear-off toolbars very easy (among other
things), and I'd really like to see this TIP implemented in some form or
another.

Comments?

--
Mark G. Saye
markgsaye @ yahoo.com

Don Porter

unread,
Aug 11, 2003, 1:13:57 PM8/11/03
to
Mark G. Saye wrote:
> I've recently been writing a toolbar widget, which got me thinking again
> about TIP #125 ( http://www.tcl.tk/cgi-bin/tct/tip/125.html ), which
> proposes adding a [wm toplevel] command to convert toplevel widgets into
> frame widgets, and vice versa. It's not obvious from the main TIP site
> how to make comments,

Did you try the [Edit] link?

--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Wojciech Kocjan

unread,
Aug 11, 2003, 1:34:23 PM8/11/03
to
Mark G. Saye wrote:
> I've recently been writing a toolbar widget, which got me thinking again
> about TIP #125 ( http://www.tcl.tk/cgi-bin/tct/tip/125.html ), which
> proposes adding a [wm toplevel] command to convert toplevel widgets into
> frame widgets, and vice versa. It's not obvious from the main TIP site
> how to make comments, so I thought I would post here, and then maybe on
> the tcl-core mailing list.
>
> Anyway, my thought was that it might be more logical to leverage the
> existing toplevel -use option to enable 'tear-off' toplevels.
>
> i.e. for toolbars (for example), create a dock container:

Just out of curiosity - how can one do tearoff/docking toolbars before
this TIP is implemented?

--
WK

Bob Techentin

unread,
Aug 11, 2003, 1:59:13 PM8/11/03
to
"Wojciech Kocjan" <wojc...@n0spam-kocjan.org> wrote

>
> Just out of curiosity - how can one do tearoff/docking toolbars
before
> this TIP is implemented?


BLT's tabnotebook allows you to tear out panes into toplevels. So I
guess you could write some C code. :-)

Bob
--
Bob Techentin techenti...@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/


Mark G. Saye

unread,
Aug 11, 2003, 2:29:52 PM8/11/03
to
Don Porter wrote:
> Mark G. Saye wrote:
>
>>I've recently been writing a toolbar widget, which got me thinking again
>>about TIP #125 ( http://www.tcl.tk/cgi-bin/tct/tip/125.html ), which
>>proposes adding a [wm toplevel] command to convert toplevel widgets into
>>frame widgets, and vice versa. It's not obvious from the main TIP site
>>how to make comments,
>
>
> Did you try the [Edit] link?

Well, I saw it, but I thought that was either for the original author,
or for TCT action. It looked rather official just for regular comments
:-) If that's the right place to add notes, I'll do that. Should I add
notes to the main "Body:" section, or the "Log:" section? Thanks.

Jeff Hobbs

unread,
Aug 12, 2003, 1:52:11 AM8/12/03
to
Wojciech Kocjan wrote:

I think Mark's idea sounds good, but previously you would have to
reparent somehow. BLT has some facilities for this, but the other way
was to just recreate the buttons on the fly in a new toplevel and/or
frame (whichever way you were going). This works surprisingly well and
is a very quick operation.

Someone will have to look into the issues of event passing because IIRC
there are some quirks with embedded toplevels in some situations.

--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions

Georgios Petasis

unread,
Aug 18, 2003, 9:47:18 AM8/18/03
to
In an implemetation I had written, I simply hided the frame
that contained the toolbar widgets and created a toplevel
in which I placed exact copies of the original widgets in the toolbar.
I replicated everything, even their bindings...

George

"Wojciech Kocjan" <wojc...@n0spam-kocjan.org> wrote in message
news:bh8k3a$86o$1...@atlantis.news.tpi.pl...

0 new messages