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

themed toolbar demonstration question

42 views
Skip to first unread message

bfrost

unread,
Jul 1, 2016, 4:37:26 PM7/1/16
to
I am studying the Tk demos and wonder why the tearoff and untearoff procs and the <B1-Motion> bindings are used in the toolbar.tcl demo because at least on my system they are not called? I put a puts command in tearoff upon entry (I was interested in seeing the cloned menu name) and it was never called when I created a tearoff menu. Is this a bug or a change in behavior that is expected? Otherwise, the demonstration works okay (but I am trying to understand the point of the code).

I am running version 8.6.5 on OpenSuSE Tumbleweed.

Christian Gollwitzer

unread,
Jul 3, 2016, 3:34:18 AM7/3/16
to
Am 01.07.16 um 22:37 schrieb bfrost:
> I am studying the Tk demos and wonder why the tearoff and untearoff
> procs and the <B1-Motion> bindings are used in the toolbar.tcl demo
> because at least on my system they are not called? I put a puts
> command in tearoff upon entry (I was interested in seeing the cloned
> menu name) and it was never called when I created a tearoff menu.

You must have done something wrong trying to execute your code. If I
repeat the same experiment, it works and prints upon motion. BTW, I
didn't know that you can edit the code and run the changed code using
the re-run button. Very cool feature of the widget demo!

> Is
> this a bug or a change in behavior that is expected? Otherwise, the
> demonstration works okay (but I am trying to understand the point of
> the code).

tearoff gets called when you hold down the left mouse button and move
while being on the tearoff bar. It is very simplistic: as soon as the
mouse cursor leaves the toolbar, the window is torn off. In a "real"
implementation, you would expect that the window moves with the mouse
and that the toolbar can be dropped back on the main window again. That
would require some more work. The name of the window does not change.
"wm manage" allow you to convert between toplevels and and frames.

Christian
0 new messages