Re: transient windows on win32
- From: Tim Evans <t evans aranz com>
- To: gtk-devel-list gnome org
- Cc: Tor Lillqvist <tml iki fi>
- Subject: Re: transient windows on win32
- Date: Wed, 02 Nov 2005 17:54:19 +1300
Tor Lillqvist wrote:
[...] On X11 the color selector dialog also is only decorated with a
"close" button, it can't be minimized or maximized. Any idea how to
achieve this on Win32, too?
The code I use for dialogs under win32 does this using
gdk_window_set_decorations. The actual code that I use looks something
like this (pygtk sorry):
def _set_dialog_realized(w, decor):
w.window.set_decorations(decor)
def set_dialog(window, parent,
resize=True, minimize=False, maximize=False,
menu=False):
resize = window.get_resizable()
maximize = maximize and resize
decor = gtk.gdk.DECOR_TITLE | gtk.gdk.DECOR_BORDER
if resize: decor |= gtk.gdk.DECOR_RESIZEH
if minimize: decor |= gtk.gdk.DECOR_MINIMIZE
if maximize: decor |= gtk.gdk.DECOR_MAXIMIZE
if menu: decor |= gtk.gdk.DECOR_MENU
window.set_transient_for(parent)
window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
window.connect('realize', _set_dialog_realized, decor)
if window.flags() & gtk.REALIZED:
_set_dialog_realized(window, decor)
It probably goes without saying that it would be nice if gtk would do
some of this itself. Some of this is really the job of the window
manager, but unfortunately windows only comes with one, and it's not all
that great :-)
--
Tim Evans
Applied Research Associates NZ
http://www.aranz.co.nz/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]