Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: (bbfu) (fullscreen considerations) Re3: Center a Tk window on the screen

by {NULE} (Hermit)
on Jan 04, 2003 at 22:45 UTC ( #224324=note: print w/replies, xml ) Need Help??


in reply to (bbfu) (fullscreen considerations) Re3: Center a Tk window on the screen
in thread Center a Tk window on the screen

Yeah - that's fine. I was going to put something in the help about how you could turn autohide on if you want to use fullscreen. At any rate, it's nice to have the option, for those that don't mind tweaking things a bit to use it.

This is what I ended up using and it works well, excluding the stay-on-top thing (tested on SuSE 8.0 (5.6.1) and Win98 (ActiveState-5.8.0):

if ($s->{fullscreen}) { $s->{fullscreen} = 0; $w->{main}->withdraw; $w->{main}->update; $w->{main}->overrideredirect(0); $w->{main}->geometry($s->{windowed}||"800x600+20+20"); $w->{main}->deiconify; $w->{main}->update; } else { $s->{fullscreen} = 1; $s->{windowed} = $w->{main}->geometry; $w->{main}->withdraw; $w->{main}->update; $w->{main}->overrideredirect(1); $w->{main}->geometry($w->{main}->screenwidth."x".$w->{main}->scree +nheight."+0+0"); $w->{main}->deiconify; $w->{main}->update; }
{NULE}
--
http://www.nule.org
  • Comment on Re: (bbfu) (fullscreen considerations) Re3: Center a Tk window on the screen
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://224324]
help
Chatterbox?
[Corion]: A good Monday to everybody!
[Discipulus]: good morning Corion and all monks!!

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2017-03-27 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (316 votes). Check out past polls.