Um, in the interface, is there a way to edit a buttons command so it's something like DialogOption(thisbuttonscurrenttext)?
Meaning, if it's text is "Hail", it'll call DialogOption("Hail"), but if it's currently "Shop", it'll call DialogOption("Shop")?
EDIT:
I meant Text, not Name.
ID:156610
Aug 27 2010, 9:12 pm (Edited on Aug 27 2010, 9:24 pm)
|
|
Aug 27 2010, 9:18 pm
|
|
Just incase someone was replying, I meant it's current visible text, not name.
|
Just put a space after the command and then the parameter you want to pass to it
For example, to send the text "Shop" to the DialogOption verb, set the Button's command to: DialogOption "Shop" Then in your code: verb/DialogOption(T as text|null) |
In response to DarkCampainger
|
|
DarkCampainger wrote:
Just put a space after the command and then the parameter you want to pass to it > verb/DialogOption(T as text|null) Not what I meant at all. The button text changes at realtime, if it changes from Shop to "Work", I want it to send Work instead of Shop. Edit: Wait, I can just change the command it sends when I change the text, can't I? |
In response to Asellia
|
|
You can use a winget() call to see what the text of the button is.
A is the object containing the button (usually src). var/btn_text = winget(A, "this_window.this_control", "text") btn_text would then contain whatever text the button currently shows. So, perhaps... proc Note that I didn't use a parameter for this. Is this something that might be doable? |
In response to Asellia
|
|
@edit : uhh...yea :D
winset(src, "window.button", "command='DialogOption Work'") you probably know that already but just making sure. |