Mercurial > octave-dspies
view examples/globaldemo.cc @ 18707:f31fde98c872 gui-release
use shortcut manager for the window menu
* main-window.cc (construct_window_menu_item): add action and connect its slot;
(construct_window_menu): created menu actions are class variables, removed
calls to connect which are now obsolete here;
(set_global_shortcuts): call shortcut manager for setting the shortcuts
* main-window.h: construct_window_menu_item with other parameters, window
actions as class variables
* shirtcut-manger.cc (do_init_data): insert debug actions into the list
author | Torsten <ttl@justmail.de> |
---|---|
date | Wed, 30 Apr 2014 19:33:55 +0200 |
parents | be41c30bcb44 |
children |
line wrap: on
line source
#include <octave/oct.h> DEFUN_DLD (globaldemo, args, , "Global Demo") { octave_value retval; int nargin = args.length (); if (nargin != 1) print_usage (); else { std::string s = args(0).string_value (); if (! error_state) { octave_value tmp = get_global_value (s, true); if (tmp.is_defined ()) retval = tmp; else retval = "Global variable not found"; set_global_value ("a", 42.0); } } return retval; }