Re: [pygtk] reserve screen space / prevent overlapping



On Wed, 2011-05-25 at 22:50 +0200, Benjamin Trias wrote:
> Hi list,
> 
> I am trying to port from Gtk+2 to Gtk+3 using Python (PyGobject Introspection)
> 
> I am trying to find the equivalent of:
> gtk.Window.get_toplevel().window.property_change("_NET_WM_STRUT",
> "CARDINAL", 32, gtk.gdk.PROP_MODE_REPLACE, [0,0,24,0])
> 
> which i used to reserve screen space (24 pix at bottom of screen).
> 
> In Gtk+3 the Gtk.Window() does not have a "window" attribute and
> nowhere do i find the gdk_property_change() method equivalent in the
> Gdk modules (which i would expect to be Gdk.property_change(), in fact
> the property_delete() and property_get() are listed).
> 
> How to change the Gdk window properties with PyGI to reserve screen space?
> Could a binding be missing? Or do i miss some library?
> Anyone has an idea?

PyGI has removed .attributes, so the replacement to get the GdkWindow)
would be get_widget_get_window() or Gtk.Widget.get_window() from g-i.

However, property_change is annotated with (skip) in the bindings
because of the nature of the data argument - unsigned char * + length
but callers should explicitly cast other property types (that are
greater than sizeof(char)).

Its a bit of an ugly C-api, and I played with the annotations a bit. The
best g-i could do was only accept n-values between 0 - 255 and format=8.

Based on the large amount of c-code in the pygtk override for this
function, I think it might be easier to just add multiple functions to
gdk3 to replace this one

property_change_8(... const guint8 *data ...)
property_change_16(... const guint16 *data ...)
property_change_32(... const guint32 *data ...)

I suggest filing a bug with gtk.

John

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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]