|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Double click / right click in pgugrid widgethi list,
Our Python table widget uses OpenEV/pymod/pgugrid.py's class pguGrid. We'd like to add some capability such as: 1) Double clicking - such as double click a cell contains an image name to load the image in OpenEV viewer. 2) Right click - give a menu for options like load, delete, delete all There are notes at the beginning of pgugrid.py (see below) that probably indicates that double clicking was not implemented. Can pgugrid widget handle the above 1) and 2), if not, what widget would you recommend to use? thanks, Shawn from pgugrid.py ----------------------------------------------- # NOTE: This grid has to simulate double click behaviour by tracking the # last clicked row/column/cell because on windows a) the gtk double click # event is not sent out if the callback on the single click event is too # long (this can happen for row selection when there are a large number # of shapes- on the order of 50000- and the expose event demands a lot # of the cpu), # and b) even if the double click event is sent out, the associated # single press events are sent out in different orders on windows than # they are on linux/unix. The sequence of events sent out for a double # click is as follows: # linux/unix: BUTTON_PRESS, BUTTON_PRESS, _2BUTTON_PRESS # windows: BUTTON_PRESS, BUTTON_PRESS (if single press callback is too long) # BUTTON_PRESS, _2BUTTON_PRESS, BUTTON_PRESS # # GTK's double click behaviour is reasonable for linux/unix, but for # consistency the approach for all platforms has been to treat the # double click event as a single click event and track the last # clicked cell/row/column internally. Internally, the grid only uses the # simulated double click event to launch cell editing. # # The better alternative would be to fix gtk itself for windows, but this # could be complicated and would require new users to build a special # version of gtk for windows... # # THIS SHOULD BE REVISITED IF OPENEV IS UPGRADED TO GTK2, AS GTK2 MAY # NOT SUFFER THESE PROBLEMS. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Openev-discuss mailing list Openev-discuss@... https://lists.sourceforge.net/lists/listinfo/openev-discuss |
|
|
Re: Double click / right click in pgugrid widgetHi Shawn,
On Wed, Apr 30, 2008 at 3:07 PM, Gong, Shawn (Contractor) <Shawn.Gong@...> wrote: > hi list, > > There are notes at the beginning of pgugrid.py (see below) that probably > indicates that double clicking was not implemented. Quite frankly, I am not sure what those notes mean... I guess only the original authors can answer that. > Can pgugrid widget handle the above 1) and 2), if not, what widget would > you recommend to use? Unfortunately, I cannot help you with this one... but the key phrase is here: > # THIS SHOULD BE REVISITED IF OPENEV IS UPGRADED TO GTK2, AS GTK2 MAY > # NOT SUFFER THESE PROBLEMS. And indeed, it doesn't (the double-clicking part anyways). For CIETmap, I have implemented a completely different grid based on the powerful (but a bit cumbersome) gtk.TreeView so I wouldn't know how pgugrid itself would behave in the GTK2 environment. Good luck. cheers -- Mario B. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Openev-discuss mailing list Openev-discuss@... https://lists.sourceforge.net/lists/listinfo/openev-discuss |
| Free embeddable forum powered by Nabble | Forum Help |