Here's something to try, it centers as well:
#!/usr/bin/perl
use Tk;
use strict;
my $mw=tkinit;
$mw->withdraw; #avoid the jumping window bug
$mw->Popup;
MainLoop;
| [reply] [d/l] |
| [reply] |
Hmm, Mastering Perl/Tk has a section on it in Chapter 12.
Otherwise, a good source of info is doing a http://groups.google.com search for "tk Popup methods"
| [reply] |
Sweet. How coincidental - I was pondering exactly this the other day. I've been rewritting the old windows video-game Gazillionaire (http://www.lavamind.com/gaz.html) in Perl/Tk for my own amusement recently and I was thinking about how to do a fullscreen mode using just Tk. Between this and your other node on removing decorations, this is perfect!
$w->{main}->overrideredirect(1);
$w->{main}->geometry($w->{main}->screenwidth."x".$w->{main}->screenwid
+th."+0+0");
{NULE}
--
http://www.nule.org | [reply] [d/l] |
Of course, if you're running it in MS win32, you should be aware that any "stay on top" windows (such as the taskbar and, on my computer anyway, Trillian) will still be in front. You'll have to do something using Win32 or Win32::API to move them to the back, probably. Although, it's possible Tk has some way to force a z-order for your window (I haven't checked).
bbfu
Black flowers blossum
Fearless on my breath
| [reply] |
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 | [reply] [d/l] |