TreeEditor double click

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

TreeEditor double click

Jordan Ilott
I've spent quite a bit of time trying to understand how to handle a double click on a tree node in the TreeEditor. I have found that I'm supposed to pass a callable to the TreeEditor constructor as: on_dclick=callable ; however, I haven't been successful. Can anyone provide an example to help me understand this? I'm trying to build a Tasks application and need to update the central pane when a node is double clicked on a TreeEditor in a dock pane.

Thanks

Jordan

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: TreeEditor double click

Gary Ruben-2
Hi Jordan,

Perhaps you don't have to pass a callable, although this may differ for TraitsUI versus Enaml? TraitsUI provides events for double-clicks on nodes. The application I'm currently working on has a TreeEditor with separate panels also.

See
http://github.com/AustralianSynchrotron/sinspect
specifically the _group_dclick() and _region_dclick() handlers in
http://github.com/AustralianSynchrotron/sinspect/blob/master/app.py
and the associated hooks in the tree_editor definition at lines 737 and 747,

Hope this helps,
Gary

From: [hidden email] [[hidden email]] on behalf of Jordan Ilott [[hidden email]]

Sent: Friday, 22 March 2013 6:12 AM

To: [hidden email]

Subject: [Enthought-Dev] TreeEditor double click





I've spent quite a bit of time trying to understand how to handle a double click on a tree node in the TreeEditor. I have found that I'm supposed to pass a callable to the TreeEditor constructor as: on_dclick=callable ; however, I haven't been successful.
 Can anyone provide an example to help me understand this? I'm trying to build a Tasks application and need to update the central pane when a node is double clicked on a TreeEditor in a dock pane.



Thanks



Jordan





_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: TreeEditor double click

Pietro Berkes
In reply to this post by Jordan Ilott
Hi Jordan,

a callable should work. I modified the TreeEditor_demo.py example to react on double click, see lines 69-70 and 110.

Best,
Pietro





On Thu, Mar 21, 2013 at 7:12 PM, Jordan Ilott <[hidden email]> wrote:
I've spent quite a bit of time trying to understand how to handle a double click on a tree node in the TreeEditor. I have found that I'm supposed to pass a callable to the TreeEditor constructor as: on_dclick=callable ; however, I haven't been successful. Can anyone provide an example to help me understand this? I'm trying to build a Tasks application and need to update the central pane when a node is double clicked on a TreeEditor in a dock pane.

Thanks

Jordan

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev




--
Pietro Berkes
Scientific software developer
Enthought UK


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

TreeEditor_demo.py (7K) Download Attachment