Hello all,
I'm trying to accomplish the apparently simple task of creating a GTK window that's the size I want it to be, and not the size the desktop environment wants it to be.
I'm working with the Perl-GTK bindings on an Ubuntu box, but I'm really looking for solutions that will work on a range of different OSs.
Can anyone point me in the right direction with the following problems?
1. How can I get the actual available size of the desktop? The following code gives the maximum resolution, but the size of the desktop actually available to my GTK windows is somewhat less (it is reduced by one taskbar in Windows; by two in Ubuntu.)
my $screen = $windowHandle->get_screen; my $width = $screen->get_width; my $height = $screen->get_height;
2. The following code creates a window and resizes it. However, the specified size seems to be applied only to the window's client area, not the whole window. (Example: ff the client area is 300x200, the actual size of the window is likely to be something like 300x215.)
my $windowHandle = Gtk2::Window->new('toplevel'); $windowHandle->signal_connect('delete_event' => sub { exit; }); windowHandle->resize($self->currentWidth, $self->currentHeight);
My question is, how can I resize the window, so that it is actually 300x200?
3. I've found that GTK windows like to resize themselves whenever they feel the need. One particularly annoying example is a window containing a scrollwindow, which contains a textview. Word wrapping is turned on, but as soon as the first text is written, the width of the window increases by about 4 pixels.
Is there a general (meaning, 'elegant') way to discourage GTK windows from resizing themselves?
In reply to gtk window sizes by ronlewis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |