# Kontakt menu graphic



## Discotron (Jul 24, 2017)

Hi guys/girls,
I'm trying to work out how to make a graphic for a menu but I'm not having much luck.

Here is what I have done:

declare ui_menu $reverb_ir

set_control_par_str(get_ui_id($reverb_ir),$CONTROL_PAR_PICTURE,"revgraphic")
add_menu_item ($reverb_ir,"Gothic 1",0)
add_menu_item ($reverb_ir,"Gothic 2",1)
add_menu_item ($reverb_ir,"Gothic 3",2)
add_menu_item ($reverb_ir,"Room small",3)
add_menu_item ($reverb_ir,"Room medium",4)
add_menu_item ($reverb_ir,"Room Large",5)
add_menu_item ($reverb_ir,"Strange",6)

Is it possible to make a menu display a graphic (instead of the usual grey box and text) with a none player instrument menu?
I basically want the usual menu text to appear when I click on the menu graphic (for example Gothic 1) and then when the menu selection has been made a graphic will be displayed to show the selection (Gothic 1).

Thank you in advance for any guidance you may be able to offer.


----------



## paoling (Jul 24, 2017)

One way is layering an invisible menu (with an invisible skin and offsetting the Text with text_alignment properties) and place a Slider with your graphic under it. Another way would be to change the skin of the menu at each selection, but I prefer the menu over slider method.


----------



## Discotron (Jul 24, 2017)

Thanks Fluffy Audio.


----------



## Lindon (Jul 25, 2017)

take a look at textpos_y if you offset your menu text by enough it will no longer appear "on the button" but all menu options will appear when you click on the menu.


----------



## Discotron (Aug 12, 2017)

Lindon said:


> take a look at textpos_y if you offset your menu text by enough it will no longer appear "on the button" but all menu options will appear when you click on the menu.


Thank you, that works great.


----------



## olmerk (Oct 10, 2017)

Do I understand it correct that $CONTROL_PAR_PICTURE_STATE doesn't work with menus? So far I managed only to use a bunch of individual pics, changing them with $CONTROL_PAR_PICTURE depending on a selected menu item... But this requires a lot of picture slicing. It would be nice to work with one stacked picture.


----------



## EvilDragon (Oct 10, 2017)

Correct, it doesn't work with menus, buttons, switches, XY pads, etc. It only works with labels, basically.

So to do what you want, use a fully transparent image for the menu, and use your actual menu graphic on a ui_label, and the you can change picture state easily.


----------



## P.N. (Oct 10, 2017)

EvilDragon said:


> Correct, it doesn't work with menus, buttons, switches, XY pads, etc. It only works with labels, basically.



$CONTROL_PAR_PICTURE_STATE does work with XY pads backgrounds.


----------



## EvilDragon (Oct 10, 2017)

With BG yes, with cursors, no, since they are basically buttons too.


----------



## olmerk (Oct 18, 2017)

EvilDragon said:


> So to do what you want, use a fully transparent image for the menu, and use your actual menu graphic on a ui_label, and the you can change picture state easily.



It was exactly I tried after pondering a bit over it) But anyway thanks!

Have another related question... It seems that set_menu_item_visibility doesn't work for a currently selected menu item. 

As an example - I have menu1 with 1,2,3,4,5 entries and menu2 with the same 1,2,3,4,5 values. Say I've selected 3 in menu1 and 4 in menu2, and in both on_ui_control callbacks for menu1 and menu2 I put the following :

on ui_control menu1
set_menu_item_visibility (get_ui_id($menu1),menu1-1,0)
set_menu_item_visibility (get_ui_id($menu2),menu1-1,0)

and

on ui_control menu2
set_menu_item_visibility (get_ui_id($menu1),menu2-1,0)
set_menu_item_visibility (get_ui_id($menu2),menu2-1,0).

Which is supposed to hide the currently selected values 3 and 4 from both menus.

However when I expand menu1 I still see 3 there, but no 4 and when I open menu2 I see NO 3 there, but I do see 4.

So am I right that selected values can not be made invisible inside the menu or am I doing something wrong?


----------



## EvilDragon (Oct 18, 2017)

No, you cannot hide currently selected menu item from its own menu, that is by design.

You can do what you want, though - you need to go through ALL menu entries in menu 1, set them all to visible, then hide menu 2 value, and then do exactly the same but in the opposite way for the other menu. Best have it in a function.


----------

