I understand your question, but I must say that doing it this way (and thus not considering any panels or taskbars):
# Create the main window
my $main = MainWindow->new();
# Maximize the window
my ($screenw, $screenh) = ($main->screenwidth, $main->screenheight);
$main->geometry($screenw."x".$screenh);
Works for me on both KDE, Gnome and Win98. It just maximizes the main window and does not go behind panels or taskbars.
hth
Jouke Visser, Perl 'Adept'
| [reply] [d/l] |
Hmmm,
Interesting... I'm doing the same thing and it doesn't work
for me! Here's my code below:
my $mw = MainWindow -> new ();
$screen_h = $mw -> screenheight ();
$screen_w = $mw -> screenwidth ();
$mw -> geometry ($screen_w . "x" . $screen_h);
Any suggestions?
- Jeff
| [reply] [d/l] |
Well, at first glance it appears as though the answer to your question is
"no".
I don't believe that Tk provides any information about a "panel" on any given
OS/Window Manager/GUI. Actually just looking at that last sentence it's quite
obvious why not. Plainly put, there are simply too many different options. From
the Gnome Panel to the KDE panel, to WM's docking bar, or FVWM95's "start bar",
even MS-Windows has different "shells" that don't use a Start bar.
There are some other options though - perhaps using takefocus/always focus
within Tk will help ( I believe these are valid methods in Tk for
toplevel objects). Though this will put it simply on top of the menu, and
whether that will work for all of them I don't know (does the MS-Windows start
menu relinquish it's always on top to other always on top apps? Is this
implemented properly in Win32 port of Tk?).
Perhaps the other option is some dirty hacks to find out position and size of
current "panels". The gnome panel stores it's size info in
~/.gnome/panel.d/panel, Win32 probably has some info in the registry as to location and
size of Start menu, I'm sure that KDE has some info regarding it's panel as
well. The problem comes down to where and whom is going to be using the app. Good luck, oh and BTW if you ever find out where exactly in the registry Start menu info stays, please let me know ;-) | [reply] [d/l] |