Problem with 'grab'... please help. 
Author Message
 Problem with 'grab'... please help.

I've noticed a behavior with the grab mechanism which I
haven't been able to find a solution for.  The problem has
to do with a sub-window which contains a tk_optionMenu widget.
When the sub-window is displayed, the grab works, and the
other windows are inactive, however, if you activate the
tk_optionMenu widget, the effect of the grab seems to disappear
and the other windows are again active.

It can be demonstrated with the following code:

-=-=-=-=-
toplevel .top
button .top.b1 -text Panic -command subwin
pack .top.b1

proc subwin {}  {

    toplevel .sub
    button .sub.b1 -text Ok -command { destroy .sub }
    tk_optionMenu .sub.optmenu opt "Red"  "White" "Blue"
    pack .sub.optmenu .sub.b1
    focus .sub
    grab .sub

Quote:
}

-=-=-=-=-

The 'Panic' button is inactive until you manipulate the optionMenu
and then it becomes active.  I would expect the initial window to
be inactive until a 'grab release' is performed or until the sub-window
is destroyed.

Have I done something wrong here?  If this is a known bug, is there a
known
work-around?



Fri, 17 Mar 2000 03:00:00 GMT  
 Problem with 'grab'... please help.

I've noticed a behavior with the grab mechanism which I
haven't been able to find a solution for.  The problem has
to do with a sub-window which contains a tk_optionMenu widget.
When the sub-window is displayed, the grab works, and the
other windows are inactive, however, if you activate the
tk_optionMenu widget, the effect of the grab seems to disappear
and the other windows are again active.

It can be demonstrated with the following code:

-=-=-=-=-
toplevel .top
button .top.b1 -text Panic -command subwin
pack .top.b1

proc subwin {}  {

    toplevel .sub
    button .sub.b1 -text Ok -command { destroy .sub }
    tk_optionMenu .sub.optmenu opt "Red"  "White" "Blue"
    pack .sub.optmenu .sub.b1
    focus .sub
    grab .sub

Quote:
}

-=-=-=-=-

The 'Panic' button is inactive until you manipulate the optionMenu
and then it becomes active.  I would expect the initial window to
be inactive until a 'grab release' is performed or until the sub-window
is destroyed.

Have I done something wrong here?  If this is a known bug, is there a
known
work-around?



Fri, 17 Mar 2000 03:00:00 GMT  
 Problem with 'grab'... please help.


  In a message on Mon, 29 Sep 1997 14:31:22 -0700, wrote :

"AH> I've noticed a behavior with the grab mechanism which I
"AH> haven't been able to find a solution for.  The problem has
"AH> to do with a sub-window which contains a tk_optionMenu widget.
"AH> When the sub-window is displayed, the grab works, and the
"AH> other windows are inactive, however, if you activate the
"AH> tk_optionMenu widget, the effect of the grab seems to disappear
"AH> and the other windows are again active.
"AH>
"AH> It can be demonstrated with the following code:
"AH>
"AH> -=-=-=-=-
"AH> toplevel .top
"AH> button .top.b1 -text Panic -command subwin
"AH> pack .top.b1
"AH>
"AH> proc subwin {}  {
"AH>
"AH>     toplevel .sub
"AH>     button .sub.b1 -text Ok -command { destroy .sub }
"AH>     tk_optionMenu .sub.optmenu opt "Red"  "White" "Blue"
"AH>     pack .sub.optmenu .sub.b1
"AH>     focus .sub
"AH>     grab .sub
"AH>
"AH> }
"AH> -=-=-=-=-
"AH>
"AH> The 'Panic' button is inactive until you manipulate the optionMenu
"AH> and then it becomes active.  I would expect the initial window to
"AH> be inactive until a 'grab release' is performed or until the sub-window
"AH> is destroyed.
"AH>
"AH> Have I done something wrong here?  If this is a known bug, is there a
"AH> known
"AH> work-around?
"AH>              

I think your code is perfectly ok.  I just tried it on my Linux box
(XFree86 3.1.2, Kernel 1.2.13, wish 4.0 and wish 4.2, fvwm) and your
code above works just fine.

--
                                     \/

http://vis-www.cs.umass.edu/~heller  ||FidoNet:    1:321/153
http://netmar.com/mall/shops/heller  /\



Sat, 18 Mar 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. grabs and problems with grabs: they don't seem to work

2. Problem with 'grab'

3. BUG?: Tk4.0b3 'grab' problems

4. LabView 5.1.1, 'Failure: "linker.c", line 1825': Please Help

5. Help please, 'shuffle' a list

6. Please help- Killing Python 'processes'

7. Grab output from 'tail'

8. 'grab' fails for modal dialog

9. stream('file','c','seek ='x) problem

10. HELP: 'menu -command' PROBLEM

11. 'send' problems with xauth - help sought

12. HELP : TK4's trace has problem with itcl's method

 

 
Powered by phpBB® Forum Software