| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Mar 22, 2006 8:48 pm Post subject: Dynamically update groupbox text |
|
|
I have a groupbox and it is associated with a dropdown menu. I want the text to change to the selected text of the dropdown menu.
Is there a better way than to create several boxes in the same place and then show or hide them as needed? |
|
| Back to top |
|
 |
rlandersen
Joined: 22 Mar 2006 Posts: 7
|
Posted: Wed Mar 22, 2006 9:32 pm Post subject: |
|
|
Actually this question goes for any menu item.
I have an action associated with a change in the combo box that will call a function that has some lines like
gui, add, checkbox, vVar1 show%var2%, text
When I change the dropdown box everything functions correctly but I get an error on the second time I change the state that states that same variable cannot be used for more than one control per window. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Mar 22, 2006 9:49 pm Post subject: |
|
|
| That is correct. You can only add a control once. After that you should use GuiControl to show/hide a control, or to change it's text, size, state, etc. |
|
| Back to top |
|
 |
rlandersen
Joined: 22 Mar 2006 Posts: 7
|
Posted: Wed Mar 22, 2006 10:10 pm Post subject: Solved |
|
|
Thanks
It is the control: GuiControl that changes that status. So I had to create the controls at the first and then on menu selection call guicontrol, show%var2% to switch.
One more question, when I first enter the menu, I do the command:
"Gui, Add, Checkbox, vVar1 show0, Open"
or the command:
"Gui, Add, Checkbox, vVar1 hide, Open"
and it will not hide the item. Does an add always show it? How can I add the element but not display it. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Thu Mar 23, 2006 5:50 am Post subject: |
|
|
HI,
The above Guest was also me.
You should take a look at the manual. The option for Gui,Add is "hidden%var%", on GuiControl it is "show%var%" or "hide%var%". _________________ Ciao
toralf  |
|
| Back to top |
|
 |
|