pyxfce panel plugin
daniele favara
danjele at gmail.com
Sun Mar 19 17:55:13 CET 2006
On 3/19/06, Jasper Huijsmans <jasper at xfce.org> wrote:
> daniele favara schreef:
> > On 3/19/06, Danny Milosavljevic <danny.milosavljevic at liwest.at> wrote:
> >> Hi,
> >>
> >> Am Donnerstag, den 16.03.2006, 08:42 +0100 schrieb daniele favara:
> >>> hi all,
> >>>
> >>> i decided to test pyxfce ... and here there is a first panel plugin in python.
> >>>
> >>> bzr: http://www.dsslive.org/bzr/basilico/
> >>> tar.gz: http://www.dsslive.org/downloads/basilico/
> >>> shots: http://www.dsslive.org/mediawiki/index.php/Basilico
> >>>
> >>> it would be nice if someone could test it.
> >> nice :)
> >>
> >> Works here
> >>
> >>
> >>> i would even help on writing the pyxfce referencies .. if someone
> >>> could help me on that, i don't really know how it is normally done.
> >> Depends on what kind of docs you want to write... most of the bindings
> >> are just generated code so the xfce C docs are usually sufficient for a
> >> reference...
> >
> > it would be useful i think to have sae doc as pygtk.
> >
> >> But for example a tutorial would be nice to have :)
> >>
> >>
> >>> it's really far from being stable ... but the main issue i found was
> >>> that i couldn't resize the gtk.Container ... is it me or a pyxfce bug
> >>> ?
> >> What do you mean? resize what? Containers resize automatically...
> >> whenever the allocation of the contents changes...
> >
> > label=gtk.Label("Computer")
> > #label=gtk.Label()
> > label.set_size_request(args[0],128)
> > #print "=======================",label.get_size_request()
> > label.show()
> > # === Add Label and Icon to Box ===
> > box.pack_start(icon,expand=True, fill=True, padding=0 )
> > #box.add(icon)
> > box.pack_end(label,expand=True, fill=True, padding=0 )
> > #box.add(label)
> >
> > i would expect here to have:
> >
> > [icon | computer] (as for xfce4-menu plugin)
> >
> > but the button size doesn't change.
> >
>
> Do you handle the size-changed event from the plugin? There is a default
> handler that will run otherwise. A C handler must return TRUE to prevent
> the default handler to run; I presume there is something similar for the
> python bindings?
>
== __init__ ==
self.constructor=xfce4.panel.Plugin()
self.constructor.window.set_geometry_hints(min_width=128)
self.constructor.connect("size-changed",self.cb_size) # Init Panel Plugin
== self.cb_size ==
here is the whole gtk stuff ... button box and so on as the
size-changed signal is sent when the plugin has been added.
let's say the panel size (height) is 33 the signal return a tuple like this:
size-changed signal (33,)
then i tried even to use:
widget.set_size_request(args[0],128)
where args[0] is the size (33)
then for each widgets i tried:
print widget.get_size_request()
and i get normally:
(33, 128)
but in the panel the button has still a size of (33,33).
i can set expand True but i'll get just a really big button.
More information about the Xfce4-dev
mailing list