Execute Ruby on Layout Load

Is it possible to auto-run a ruby code after a layout is loaded from a file (either through drag/drop or File=>Open) ? I would like to auto-select the technology and apply it so the correct layers show, based on either the file name or the encountered layers.


  • Hi!

    Looks like you could handle MainWindow.on_view_created event. Alternatively you could create macro that will ask user for file name with QFileDialog, call MainWindow.load_layout and perform other customizations.


  • Hi,

    I like the second proposal of Eugene.

    You can basically capture the events which indicated a new layout, but there is also the option to add a layout to a view which you also have to consider (with what consequences I don't know). If you want to go the way of the events, capture "on_view_created" to install a new event "on_file_open" for this view. This event will be triggered finally when a layout was loaded.


Sign In or Register to comment.