• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Change Dialog Button Text?

Status
Not open for further replies.
Level 4
Joined
Jun 10, 2007
Messages
46
If I have a dialog button stored in a variable, is it possible to change its text without creating a new button? I can't find a function in the API that would do this.

Would prefer a GUI solution but I have no problems with a simple and understandable JASS solution.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Yeah its easy to change the text of a button, like this.

  • Dialog - Create a dialog button for Menu labelled Text you want
  • Set Button = (Last created dialog Button)
whenever you wanna change the text of the button just do it this way.

If you wanna change the test in a menu already made later on, you may have to clear it and just rebuild it then changing that text of that button you want.
 
Level 4
Joined
Jun 10, 2007
Messages
46
Yeah its easy to change the text of a button, like this.

  • Dialog - Create a dialog button for Menu labelled Text you want
  • Set Button = (Last created dialog Button)
whenever you wanna change the text of the button just do it this way.

If you wanna change the test in a menu already made later on, you may have to clear it and just rebuild it then changing that text of that button you want.

There's a lot of reasons doing that would be bad, memory leaks are the least of them.

I believe this will work:
JASS:
native DialogSetMessage takes dialog whichDialog, string messageText returns nothing
Ex:
JASS:
call DialogSetMessage( udg_DIALOGNAME, "STRING" )

Right idea, but I need to change a button's text.

I'm working on a Spell Copy interface, where a unit can learn one spell that other units cast in the game, and want to change the text of the button dynamically whenever I feel like it. Right now I'm just deleting the button and replacing it with a new one, then updating variables, which seems more cumbersome than it ought to be.

So yeah, any solutions you guys know of would be appreciated.
 
Status
Not open for further replies.
Top