jsj
jsj

Reputation: 9431

How do I get started creating a custom GTK widget (using python)?

This is kind of a GTK question in general but I have only used pygtk so keep that in mind if it affects the answer.

I have got the hang of the basic GTK widgets, but I now have to implement something which is not available "a la carte".

Basically I am trying to create a "timeline" similar to the old Windows Movie Maker / OpenShot timeline. My timeline will be for documents however, they can be DNDd onto the timeline and rearranged to specify their order, larger documents will be "longer" on the timeline.

It's for amalgamating existing documents.

My question is: How do I even start? Am I supposed to use a drawing area? Other GTK applications seem to have bespoke widgets that nicely match the system styles and colors - drawing area seems so primitive. Do I use styles? Do I subclass existing widgets?

tl;dr help me get started creating a unique GTK widget.

Thanks

Upvotes: 1

Views: 1271

Answers (1)

Ali Afshar
Ali Afshar

Reputation: 41667

Check the source of pygtkhelpers at http://packages.python.org/pygtkhelpers/index.html

There are a number of custom widgets there, and also a couple of helper functions to make creating properties and signals easy for you.

Upvotes: 2

Related Questions