[pygtk] Creating a canvas

Elby loic.berthe at free.fr
Fri Apr 21 03:59:57 WST 2006


I'm trying to make a canvas, where I should be able to put, select, move
element and so on.
You can find attached a first test for this canvas.
It uses a gtk.Layout and it seems to work, but I'm having difficulties
to enhance the interface.

- I want to be able to select elements by drawing a box with the mouse.

    For this, I'm using DND signals, and I've added a gtk.Image to the
    The image is updated when the 'drag-motion' signal is emitted.
    This works.
    But this is really slow.
    -> Is there a best way to do it ? Have you any idea to improve it ?

    Besides, using DND signals helps a lot, but I didn't find how to
    tell GTK not to use any drag_icon.
    So, I'm using gtk.STOCK_CUT as icon, but it doesn't have sense
    -> Is there a way to tell GTK not to use any drag_icon ?

- I want to be able combine selections when <SHIFT> or <CTRL> are pressed

    This works when I select one element with left click,  but with 
    I've got  problem  with  box selection,  because <SHIFT> key seems
    to cancel  a drag n drop.
    -> Is-there a way to prevent <SHIFT> key from cancelling a drag'n'drop ?

- I would like to bind some shortcuts  to specials keys like <del>,
<backspace> or <pageUp>

    I created a Popupmenu and I would like to use ActionGroup but I
    don't find the accelerator name corresponding to theses specials keys.
    -> Is there a way to bind <del> and  <backspace> keys ?

Don't hesitate to comment my code, I'm not very familiar with programming.


-------------- section suivante --------------
Une pi?ce jointe non texte a ?t? nettoy?e...
Nom: Test_Canvas.py
Type: text/x-python
Taille: 22126 octets
Desc: non disponible
Url: http://www.daa.com.au/pipermail/pygtk/attachments/20060420/b9f2e2e9/Test_Canvas-0001.py

More information about the pygtk mailing list