[pygtk] how to cut off the maximum button in the window?

holmes86 holmes86 at 163.com
Mon Oct 12 14:42:39 WST 2009

thanks for your reply.
 but I used self.window.window.set_decorations(decor),report this error:
AttributeError: 'NoneType' object has no attribute 'set_decorations'
I used glade,and my window is a Dialog.how to correct use the set_decorations function?thanks



在2009-10-12,"Tim Evans" <t.evans at aranz.com> 写道:
>Marco Antonio Islas Cruz wrote:
>> set the window property 'resizable' to false.
>> On Mon, 2009-10-12 at 11:28 +0800, holmes86 wrote:
>>> Hi,everyone
>>> I set window size 800x600,and I don't need window to maximum.So I want
>>> to cutting off the maximum button in the window.How can do it?
>>> thanks very much
>Alternatively, set the "decorations" of the underlying GdkWindow.  The 
>full list of decorations is: 'border', 'resizeh', 'title', 'menu', 
>'minimize', 'maximize'.  It depends on your OS (and for Linux your 
>window manager) which of these can be switched off.  Code would look 
>something like this:
>   decor = 'border', 'resizeh', 'title', 'menu', 'maximize' # no maximize
>   window.window.set_decorations(decor)
>Note that you need to wait for the GtkWindow to be realized before you 
>can access its GdkWindow.  Handling the 'realize' signal is the normal 
>way to do that, so code often ends up looking like this:
>   def on_realize_set_decor(window, decor):
>       window.window.set_decorations(decor)
>   decor = 'border', 'resizeh', 'title', 'menu', 'maximize' # no maximize
>   window.connect('realize', on_realize_set_decor, decor)
>Tim Evans
>Applied Research Associates NZ
>pygtk mailing list   pygtk at daa.com.au
>Read the PyGTK FAQ: http://faq.pygtk.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20091012/d93048d3/attachment.htm 

More information about the pygtk mailing list