Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorallonpa
    • CommentTimeJun 21st 2016
     
    Hi!
    I have created a Plugin/ PluginFactory objects to allow the user to set origin of a layout. This works very well. And I would like to ask 2 more questions:
    1. Can I invoke the plugin from a menu item (i.e, not only from the toolbar button)?
    2. Once the user presses the button, and the plugin performs what it has to do (mouse_click_event procedure), I would like the plugin to shut down (i.e, make klayout go back to “normal”). Can I do it programmatically?
    Thanks a lot!
    Allon
    • CommentAuthorMatthias
    • CommentTimeJun 23rd 2016 edited
     

    Hi Allon,

    1.) A plugin can register and act on menu entries. You can basically grab the mouse in such a handler and act on mouse events. Is that what you are looking for?

    2.) If you go for the solution of 1.) you can decide yourself when the plugin gets inactive. You need to call ungrab_mouse in that case.

    Matthias

    • CommentAuthorallonpa
    • CommentTimeJun 30th 2016
     
    Thanks Matthias. I will try and reply if successful.