Strumenti Utente

Strumenti Sito


hackish_pygtk_things

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
Prossima revisioneEntrambe le parti successive la revisione
hackish_pygtk_things [2008/12/23 00:52] – just count! pietrohackish_pygtk_things [2008/12/23 01:13] – bug? pietro
Linea 15: Linea 15:
  
 will. will.
 +
 +== Release outside widget ==
 +
 +Notice that - this may seem hackish but is very smart - release events are targeted to the widget over which the button was pressed, not to the one over which it was released (the only case where you need to know that a button pressed on some other widget was released on yours is drag and drop, which has its own methods).
  
 ==== Motion hints ==== ==== Motion hints ====
Linea 22: Linea 26:
 However, this is plainly false in pygtk 2.13.0, where instead: However, this is plainly false in pygtk 2.13.0, where instead:
   * if you only add gtk.gdk.POINTER_MOTION_HINT_MASK to your event mask, you handler for "motion_notify_event" is //never// called,   * if you only add gtk.gdk.POINTER_MOTION_HINT_MASK to your event mask, you handler for "motion_notify_event" is //never// called,
-  * if you instead add gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.POINTER_MOTION_MASK , your handler is called lots of times, even if you don't call get_pointer()+  * if you instead add gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.POINTER_MOTION_MASK , your handler is called lots of times, even if you don't call get_pointer() (and though every event received has the "is_hint" argument set).
  
 There are 3 possible explanations: There are 3 possible explanations:
Linea 29: Linea 33:
   - recent pygtk versions are buggy   - recent pygtk versions are buggy
  
-I see 2 or 3 as more probable, because the widget provided in [[http://www.pygtk.org/articles/writing-a-custom-widget-using-pygtk/writing-a-custom-widget-using-pygtk.htm|this article]] currently doesn't work.+I see 2 or 3 as more probable, because the widget provided in [[http://www.pygtk.org/articles/writing-a-custom-widget-using-pygtk/writing-a-custom-widget-using-pygtk.htm|this article]] currently doesn't work (tested on Ubuntu Intrepid, Ubuntu Hardy, OpenSolaris 08-11). 
 + 
 +Moreover, since [[http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#gdk-event-request-motions|C gtk+ documentation]] tells the same thing (with some more particulars), I definitely see 3 as most probable.
hackish_pygtk_things.txt · Ultima modifica: 2009/01/09 15:22 da pietro