Re: maximize window

From: Date: Wed, 28 Jul 2004 13:17:31 +0000
Subject: Re: maximize window
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4866@lists.php.net to get a copy of this message
On Tue, 20 Jul 2004 15:51:20 +1000 Tom Rogers <trogers@kwikin.com> wrote: > Saturday, July 17, 2004, 8:02:19 PM, you wrote: > WS> I want to maximize my window from the code, but I can't find the > WS> function for it. > > $window->>set_usize(gdk::screen_width(),gdk::screen_height()); > > WS> but this only sets the window size equal to maximize , it is not truly > WS> maximized. > > I did some tinkering and for windows came up with this solution using > the win32api. If on unix maybe you can do something similar with > gdkwindow->xid which is not available under windows IMHO we shouldn't look to GTK for problems such as this. It's simply not its job to do that, from what little I know about the internals of these things. GTK deals only with the inside part of the window. Window decorations, maximization and so on are the window manager's job. There are scenarios where simply reading the screen resolution and attempting to set the window to that size is simply wrong because users may have docks, taskbars and whatnot on the sides of their screen which may or may not be allowed to be covered. But you have to ask the window manager. What we need is to find out how to access the X API, for Linux. Tom's solution may be the answer for Windows, and you'll notice he resorted to the Windows window manager's API for that. If that gdkwindow->xid is the X window ID then that's a first step: we know the window as far as X is concerned. Now what do we do with it? The desktop is a complex environment on one platform only, let alone when porting between platforms. At some point, for certain tricks, you have to evade GTK's jurisdiction and look elsewhere, dig deeper. AND you lose portability, unless you're willing to cover all the API's you'll come across. This issue (external API's) is important IMO. There are quite a bunch of libraries out there that a desktop application may want to make use of but which don't have hooks in PHP. Examples: X, fontconfig. -- Ciprian Popovici

Attachment: [application/pgp-signature]
« previous php.gtk.general (#4866) next »