Extending the Menus of the CARA Explorer

January 3rd, 2010 rkeller No comments

The following code adds a new menu to the menubar of the CARA Explorer; the menu contains one item which calls a Lua function if triggered by the user.

gui.explorer:getMenuBar():addMenu("Test"):addAction("Say Hello",
  function() print("Hello!") end )

You can also add menu items to the context menus; you can access the context menus by the title shown in the navigation tree; the following example adds an item to the context menu of the Spectra pane:

gui.explorer:getPopup("Spectra"):addAction("Print Name",
  function() print(gui.selected:getName()) end )

Notice the selected attribute; it is automatically set by the explorer to the current item selected by the user. If you select a spectrum in the Spectra pane, selected points to a Spectrum object. If you select a spin or system in the Systems pane, selected points to a corresponding object.

Categories: Features Tags:

Towards CARA 1.9

January 3rd, 2010 rkeller No comments

A beta release of CARA 1.9 for Windows, Linux and Mac is available for download. This release is the result of a complete overhaul of the code base and architecture; the Lua binding and GUI framework have been unified and adapted to Qt 4.3 – thus replacing some legacy concepts which were necessary at Qt 2 times. Many Qt and NAF classes are now accessible to Lua and can be used in user scripts; we will provide additional documentation and examples for this during the next weeks. Also the look of the GUI has slightly changed. As a positive side effect of the overhaul a lot of reported issues have been resolved; we hope that the number of new issues is reasonably low though (notice this is a beta and not a final release yet).

CDT

Categories: CARA Releases Tags:

Welcome to the new CARA Blog!

November 11th, 2009 rkeller No comments

So let’s try to use this technology for CARA ;-)

Categories: Announcements Tags: