Custom button

Markus
2013-08-17
2013-09-02
  • Markus

    Markus - 2013-08-17

    Hi,
    I would like to create a "Move to New Instance" Button. I tryed with a macro and by editing the CustomizeToolbar.btn but it only shows error (I added the line "Move to New Instance,,,,icon.bmp").
    Anyone who can help?
    Thx
    Regards

     
  • Markus

    Markus - 2013-08-24

    No one? :-(

     
  • Loreia2

    Loreia2 - 2013-08-24

    Hi Markus,

    I didn't use Customize toolbar plugin in a loooong time, but adding buttons with Python plugin works like a charm. Can you try with that one?

    BR,
    Loreia

     
  • Markus

    Markus - 2013-08-28

    Thanks a lot! Ive looked into the Python scripting and its very interesting. But with all the samples I could not figure out how to use the ENUMS. There is this ENUM MENUCOMMAND.VIEW_LOAD_IN_NEW_INSTANCE but how to I use it on a tab?
    Thanks!

     
  • Loreia2

    Loreia2 - 2013-08-30

    Hi Markus,

    create new script with Python plugin, and save this line into it.

    ~~~~~~~~~~~~~~~~~~~~
    notepad.menuCommand(MENUCOMMAND.VIEW_LOAD_IN_NEW_INSTANCE)
    ~~~~~~~~~~~~~~~~~~~~~~

    Select to initialize on startup, and create a button. That should be all.
    If you have problems with this, ask again.

    BR
    Loreia

     
  • Markus

    Markus - 2013-08-30

    It worked! Thanks that helped a lot! :-) :-)

     
  • Loreia2

    Loreia2 - 2013-08-30

    Now just select dome nice icon, and you are done with it :-)

    BR,
    Loreia

     
  • Markus

    Markus - 2013-08-31

    Thanks a lot! Here is the result. it checks if there are more then one tab open an loads the current tab in a new window and closes the original one. Plus Icon :-)

    if len(filter(lambda item: item[3] == notepad.getCurrentView(), notepad.getFiles())) > 1:
    notepad.menuCommand(MENUCOMMAND.VIEW_LOAD_IN_NEW_INSTANCE)
    notepad.menuCommand(MENUCOMMAND.FILE_CLOSE)

     
  • Loreia2

    Loreia2 - 2013-09-02

    Nice to see it working.

    Cheers,
    Loreia

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks