Menu + submenus in the console

  • Follow


Hi,
I need to create a menu with submenus on the console's menubar, like
for the Preferences/Colors item that proposes 2 sub-items Background |
Font.
addmenu() looks the only way for creating menus in the console, unless
there is a console handle that could be use with uimenu(). How is it
possible to retrieve the console's handle ?
Or what's the syntaxe with addmenu() to create items with sub-menus ?
Thanks for any hint.
Samuel
0
Reply sgougeon (1) 12/28/2009 2:04:38 AM

On 28 d=E9c, 03:04, SG <sgoug...@free.fr> wrote:
> I need to create a menu with submenus on the console's menubar, like

I have found that default menus of the console are defined through the
file ~SCI\modules\gui\etc\main_menubar.xml , that can be successfully
customized in a fixed and limited way, by hand.
Now, I am looking for a way for doing that in a dynamical way, from a
script.
Any trick would still be welcome.
Samuel
0
Reply SG 12/28/2009 3:33:33 AM


SG a �crit :
> Hi,
> I need to create a menu with submenus on the console's menubar, like
> for the Preferences/Colors item that proposes 2 sub-items Background |
> Font.
> addmenu() looks the only way for creating menus in the console, unless
> there is a console handle that could be use with uimenu(). How is it
> possible to retrieve the console's handle ?
> Or what's the syntaxe with addmenu() to create items with sub-menus ?
> Thanks for any hint.
> Samuel

In fact addmenu is a short cut above the uimenu function

You can do what you whant this way:

h = uimenu("parent", 0, "label", 'zzzz'); //creates a new menu in the
menu bar
h1=uimenu("parent", h, "label", 'yyyy');// creates a submenu
h11=uimenu("parent", h1, "label", 'tttt','callback','foo');
h2=uimenu("parent", h, "label", 'aaaa','callback','zoo');// creates
another  submenu
0
Reply Serge 1/4/2010 5:44:33 PM

On 4 jan, 18:44, Serge Steer <Serge.St...@inria.fr> wrote:
> SG a =E9crit :
>
> > Hi,
> > I need to create a menu with submenus on the console's menubar, like
> > for the Preferences/Colors item that proposes 2 sub-items Background |
> > Font.
> > addmenu() looks the only way for creating menus in the console, unless
> > there is a console handle that could be use with uimenu(). How is it
> > possible to retrieve the console's handle ?
> > Or what's the syntaxe with addmenu() to create items with sub-menus ?
> > Thanks for any hint.
> > Samuel
>
> In fact addmenu is a short cut above the uimenu function
>
> You can do what you whant this way:
>
> h =3D uimenu("parent", 0, "label", 'zzzz'); //creates a new menu in the
> menu bar
> h1=3Duimenu("parent", h, "label", 'yyyy');// creates a submenu
> h11=3Duimenu("parent", h1, "label", 'tttt','callback','foo');
> h2=3Duimenu("parent", h, "label", 'aaaa','callback','zoo');// creates
> another =A0submenu

Thank you! i will try that. This trick is undocumented in the help
uimenu page: "parent" is not in the list of authorized properties for
uimenu(). #0 as the console is no more documented in this page.
I guess that there should be comparable hidden parent number for the
window of each manager (help, atoms, etc)
Samuel
0
Reply SG 1/8/2010 11:18:01 PM

3 Replies
632 Views

(page loaded in 0.082 seconds)

Similiar Articles:






7/21/2012 10:28:17 PM


Reply: