[pygtk] Writing a composite widget
Darren Hart
darren at dvhart.com
Thu Oct 9 00:28:05 WST 2008
On Wed, Oct 8, 2008 at 12:23 AM, Alessandro Dentella <sandro at e-den.it> wrote:
>> Is there some best-practices document or something regarding creating
>> composite widgets with gtk?
>
> I'm not really experienced in this, so please don't take my words for
> "best-practice" or the like...
>
> First suggestion (that is not strictly for composizion of widgets) is to
> read the nice docs on object for python so you can add signal and propertyes
> to your composed widget.
>
> I'd personally consider not to have many TreeViews but just one single and
> some functions to change columns visibility and model. In this case I
> *believe* it would be possible to inherit from TreeView, otherwise I'd
> inherit from HBox or directly from gobject.
>
> [1] http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html
>
Hey I'd been looking for something like that, thanks for the great
link! I think I will actually end up making a Mediator to wrap an
interface I create in glade. There really isn't any benefit I can see
of making my own widget, I'm not looking for any special rendering or
behavior, I just want to encapsulate the interactions of a group of
widgets behind a unified interface, and I think the Mediator does that
nicely. it has the added benefit of allowing me to easily tweak the
look, etc. within glade like the rest of my GUI.
--
Darren Hart
More information about the pygtk
mailing list