Menu.toggle not working
Posted
#1
(In Topic #1277)
Enthusiast

Code (gambas)
- Menu_Edit_Current_Account.Toggle ' ' This returns an error " Not An Object "
Posted
Guru

you need to set a value
/comp/gb.qt4/menu/toggle - Gambas Documentation
Gets or Sets if a menu is a toggle menu or not.
You only need to set it once.
Menu_Edit_Current_Account.Toggle = True
Menu_Edit_Current_Account.Checked = bToggleValue
Posted
Enthusiast

Do I also have to set it in the code ?
Posted
Enthusiast

I thought it was to change the value from True to False or False to True or checked to unchecked … but I guess that is not the purpose of it
Posted
Guru

Once it's a toggle menu it works just like a ToggleButton or a CheckBox where you use Value (and/or Checked)
Posted
Guru

grayghost4 said
I have it set to Toggle in the GUI
Do I also have to set it in the code ?
No. setting it in the IDE has done that for you. you only need to set it by code to make a new menu created by code be a Toggle Menu
Posted
Guru

PS.
I made up "bToggleValue" just to symbolize a boolean toggle value ,
you'll probably want to use your own variable/condition
Posted
Enthusiast

Code (gambas)
now I know that is not what is for.
1 guest and 0 members have just viewed this.





