Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

prevent auto-focus in Tk Toplevels

by batkins (Chaplain)
on Dec 23, 2002 at 17:39 UTC ( [id://221911]=perlquestion: print w/replies, xml ) Need Help??

batkins has asked for the wisdom of the Perl Monks concerning the following question:

does anyone know how to prevent a newly-created Toplevel from popping in front of all other Toplevels?

Replies are listed 'Best First'.
Re: prevent auto-focus in Tk Toplevels
by Rich36 (Chaplain) on Dec 23, 2002 at 18:08 UTC

    You could try passing the parent widget to the routine that creates the new Toplevel and then call $parentwidget->focus to give the parent widget focus. You could bind this method to when your new window takes focus.

    In Mastering Perl/Tk, there's also the method $widget->focusForce, which allows you to "force a widget to have the focus even if the applicatuion isn't currently active" (p. 299, Mastering Perl/Tk).


    «Rich36»
Re: prevent auto-focus in Tk Toplevels
by dakkar (Hermit) on Dec 25, 2002 at 18:12 UTC

    I'm not sure it is Tk's task... it looks more a problem to be taken to the window manager. Assuming, of course, you are using Tk on X11.

    If this is the case, you'll have to resort to the horror that is the ICCCM (Inter-Client Communications Converntions Manual, or How to do IPC over X11 and have nightmares). Or the (cleaner, but narrower in scope) GNOME/KDE WM conventions.

    Sorry, out of links at the moment. I'm at my parent's home, on a dial-up (56K) instead of my usual ADSL (320K)

    -- 
            dakkar - Mobilis in mobile
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://221911]
Approved by Mr. Muskrat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-28 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found