DISABLE "SAVE" and SAVE AS" on unix

edited January 2018 in General
Hello to all,

I need your help to understand if it's possible and How disabled "save" and "save as" button on graphics interface on unix

Let me know how can proceed

Best regards

Luciano

Comments

  • edited November -1
    Ciao Luciano:

    Can you clarify your question? Do you *want* the buttons disabled, or for some reason they are disabled and you don't want them disabled?

    Best regards, Erwin
  • edited November -1
    Ciao,

    Ok, I want the buttons disabled

    Thanks

    Luciano
  • edited November -1
    Hi 71lucky,
    have a look at the thread
    https://www.klayout.de/forum/comments.php?DiscussionID=700

    klayout_vo_app.exe should do what you are looking for.

    regards
    Stefan
  • edited November -1
    thanks Stefan.

    On unix I used version 0.23.11 (the last one that I can use)
    How can I use the script

    mw = RBA::Application::instance.main_window
    menu = mw.menu
    menu.action("file_menu.save").visible = false
    menu.action("file_menu.save_all").visible = false
    menu.action("file_menu.save_as").visible = false
    menu.action("@hcp_context_menu.save_cell_as").visible = false

    on unix?

    Many thanks in advance

    Ciao

    Luciano
  • edited January 2018

    Hi all,

    yes, that's the way I'd do it too .. please note that skilled users could still do that in the macro IDE or potentially in other places. You'd not achieve total safety unless you disable these features too.

    Some features that can potentially used to save layout:

    • DRC
    • Shapes to markers (save marker DB)
    • The net tracer (export nets)

    If you include images:

    • Print
    • Save screenshot

    And I'd bet a criminal mind could come up with many more options :-)

    Matthias

  • edited November -1
    Clear Matthias, thannks

    But how can run the script on unix?

    Many thanks in advance

    Luciano
  • edited November -1
    I have copied the script in a file myscript.rbm and run it on this way

    klayout -r myscript.rbm

    but doesn't work

    Please, can You help me?

    Luciano
  • edited November -1
    Solved.

    I have created file as myscript.rb and run it on this way

    klayout -r myscript.rb

    using this command "Save" and "Save As" are removed on menu "File"

    Thanks to all.

    Luciano
  • edited November -1
    Sorry to all, one more question.

    It's possible run the script automatically, inserting the name on klayoutrc file?

    Thanks for the help in advance

    Ciao

    Luciano
  • edited November -1

    Hi Luciano,

    you can turn the script into a "generic macro" (*.lym file) and put it into ".klayout/macros". Such scripts can be configured to auto-run on start.

    This file can be created using "Macros/Macro Development", "New Macro" ("+" button) and chose "Generic KLayout Macro" for the template. Rename the macro, paste your script text and in the macro properties (second tool button from the right above the macro text), enable "Run on startup".

    Matthias

  • edited November -1
    Hi Luciano,
    sorry, didn't read the KLayout forum during the last days.
    Another way to make the script autorun is to place it as *.rbm in the program folder to make it active for all users running klayout from that folder,
    or in your own KLayout folder, on Linux this should be ~/.klayout

    regards
    Stefan
  • edited November -1

    Hi Stefan,

    that's right, but *.rbm is deprecated in favour of the autorun .lym version. The effect is the same, but there are more options with .lym (for example, you can use Python).

    Matthias

  • I'm tryng to use the same file on version 0.29.0 but I received this error message.
    How can solve it??

  • Are you maybe trying to run KLayout in batch mode?

    "MainWindow" will not have an instance in that case. Hence RBA::Application::instance.main_window returns nil. In normal GUI mode, this should return the main window object.

    Matthias

  • Running this command line
    klayout -r myscript.rb

  • I don't know what "myscript.rb" is in your case, but this works for me:

    myscript.rb:

    mw = RBA::Application::instance.main_window
    menu = mw.menu
    menu.action("file_menu.save").visible = false
    menu.action("file_menu.save_all").visible = false
    menu.action("file_menu.save_as").visible = false
    menu.action("@hcp_context_menu.save_cell_as").visible = false
    

    Run KLayout with:

    klayout -rm myscript.rb
    

    ("klayout -r myscript.rb" does not start KLayout, but exits after the script is executed).

    Matthias

Sign In or Register to comment.