LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetMenuBarAttribute

Solved!
Go to solution

Bonjour,

Je veux mettre comme visible un sous item d'un item. J'utlise SetMenuBarAttribute. La question, qu'est ce que je dois mettre comme 1er et deuxième paramètre: le menubar ou le item parent ?

Cordialement.

0 Kudos
Message 1 of 10
(3,642 Views)

Bonjour,

 

this question can be answered by looking at the help, e.g. here

 

menuBarHandle is the first parameter, the menu item the second

0 Kudos
Message 2 of 10
(3,637 Views)

it's not an item but un child of un item, then, i wonder about if i have to put the bar menu or the the sub item as first parameter.

0 Kudos
Message 3 of 10
(3,632 Views)
Solution
Accepted by topic author FibiIA

Excuse moi,

 

my french isn't good enough to have realized the difference...

 

For submenues, the first parameter is the same menubar handle that you obtain from LoadMenuBar, the second parameter is the menu item id as assigned in the User Interface Editor, e.g. MENUBAR_ITEM1_2_ITEM1_4_ITEM1_14. It works both for menu items and submenu (child) items.

0 Kudos
Message 4 of 10
(3,628 Views)

well, it doesn't work, see:

SetMenuBarAttribute (MENUBAR_EM_MENU_SUPERUSER,MENUBAR_EM_MENU_SUPERUSER_ITEM_SUPRESS_ITEM_SUP_CARTE,ATTR_DIMMED, 0);

the error:

NON-FATAL RUN-TIME ERROR:   "authentification.c", line 47, col 13, thread id 0x00001168:   Library function error (return value == -4 [0xfffffffc]). Panel, menu bar, or control array handle is invalid

Smiley Frustrated

Smiley Embarassed

 

0 Kudos
Message 5 of 10
(3,625 Views)

How does your call of LoadMenuBar look like?

 

It should have some similarity with

 

panel_handle = LoadPanel ( 0, "my_gui.uir", PANEL );

menubar_handle = LoadMenuBar ( panel_handle, "my_gui.uir", MENUBAR ); Could it be that you confused the menubar_handle with MENUBAR? 

0 Kudos
Message 6 of 10
(3,622 Views)

I used the variables that i found in the .h file of the GUI see:

SetMenuBarAttribute (MENUBAR_EM_MENU_FILE, MENUBAR_EM_MENU_FILE_ITEM_IMPRESSION, ATTR_DIMMED, 0);    //this one works because it's an item,

i didn't use the menubarhandel, just the the menubar name in the .h file

SetMenuBarAttribute ( MENUBAR_EM_MENU_SUPERUSER_ITEM_SUPRESS_SUBMENU,MENUBAR_EM_MENU_SUPERUSER_ITEM_SUPRESS_ITEM_SUP_CARTE,ATTR_DIMMED, 0);//this not because it's subitem

 

0 Kudos
Message 7 of 10
(3,619 Views)

@FibiIA wrote:

i didn't use the menubarhandel, just the the menubar name in the .h file 


Why are you averse to use the menubar_handle? I would assume that by chance your MENUBAR_EM_MENU_FILE has the same numeric value as the menubar_handle, and that's the reason why this line works...

0 Kudos
Message 8 of 10
(3,616 Views)

ok, it works, i just put MENUBAR_EM_MENU_FILE as a handle, seams that it took it as a handle of the menu bar because it's the first one.

Thank you, i appreciated

0 Kudos
Message 9 of 10
(3,612 Views)

Très bien!

0 Kudos
Message 10 of 10
(3,609 Views)