[pygtk] moving a PyGTK 2.8 custom widget

Johan Dahlin jdahlin at async.com.br
Tue Jan 24 01:35:56 WST 2006


Vihan Pandey wrote:
> Hello,
>          i'm having some trouble trying to move a custom widget(in this 
> case an ellipse) in the Drawing Area. It seems to get the required mouse 
> click and motion signals but does not move.

Check out,
http://cvs.gnome.org/viewcvs/gnome-python/pygtk/examples/gtk/widget.py?view=markup

Which is a simple GtkWidget subclass which can be used as a template.
I just added some comments to make it easier to understand what the
actual methods does.

In your case, just change the do_expose_event to draw an ellipse instead of
a label and a border.

Johan


More information about the pygtk mailing list