2013/1/19 Ajay Garg <ajaygargn...@gmail.com>

> Hi all.
>
> If a gtk.Window has been maximized, it seems that the "resize()" method
> doesn't take effect thereafter.
> I will illustrate with the following code snippets ::
>
>
>
> a)
> ###################################################################
> import gtk
> import gobject
>
> win = gtk.Window()
> win.show()
>
> win.resize(683, 346)
>
> gobject.MainLoop().run()
> ###################################################################
>
>
> When the above snippet is run, the window is resized as expected.
>
>
>
>
>
>
> b)
> ###################################################################
> import gtk
> import gobject
>
> win = gtk.Window()
> win.show()
>
> win.maximize()   ### Culprit line :-(
>
> win.resize(683, 346)
>
> gobject.MainLoop().run()
> ###################################################################
>
>
>
> Here, once the window is maximized, the resize() stops working :-(
>
>
>
>
> Is it expected? Is it a bug?
> Is there anyway I can get the window to resize, AFTER calling
> window.maximize() ?
>
>
> Will be grateful for any pointers :)
>
>
> Regards,
> Ajay
>
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>


Hi Ajay,

I am not a expert, but I think that when you specify .maximize, any default
window sizes that have been set will be overridden. Then you leave the
window to the composite window manager (compiz, metacity, unity, etc) to
handle maximize/unmaximize/resize, etc.

When using .unmaximize(), the window will shrink to the size of the child
content or to any size specified.

You can get some useful trace info with window-state-event
or configure-event event. Also could be useful ensure the resizable status
with .set_resizable(True) and I recomend migrate your code to PyGObject
(For GTK 3+) https://live.gnome.org/PyGObject

So I think that you cannot maximize and after resize without user action
from composite window manager. Maybe someone with more knowledge than me
could give you more info.

Regards
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to