• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[General] How to delete a button from a dialogue

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,342
Hi,

I see you can add buttons to a dialogue, but how do you remove them?

Or do I have to remake the dialogue each time I want to remove a button?
 
So dialog.DialogClear() removes all of its buttons, but the dialog still exists (i.e. I don't have to destroy it and then remake it)?

If I have an array of those buttons, will they get deleted?

Also, if I destroy a dialogue, but still have an array of its buttons, do those still exist?
 
All of the buttons in the dialog will get removed. The array if it points to those that were deleted will point to nothing anymore.

When destroying a dialog it destroys all buttons along with it. The array will point to nothing. ( don't forget to null the array to get back the lost handles.)

Null the entire array in both cases, or null each of its entries?
 
Just to summarize my understanding, I should do this in both cases?

JASS:
call DialogDestroy(myDialog)
for i range 0 to size of myBttns
  set myBttns[i] = null
endfor
set myBttns = null
...

JASS:
call DialogClear(myDialog)
for i range 0 to size of myBttns
  set myBttns[i] = null
endfor
set myBttns = null
...
 
Status
Not open for further replies.
Back
Top