Obtain all child widgets [message #81189] |
Mon, 20 August 2012 11:09 |
Russell Ryan
Messages: 122 Registered: May 2012
|
Senior Member |
|
|
Ok, this must be easy and I'm just having "one of those days". I have a widget hierarchy, and it creates a series of buttons using the /menu feature in widget_button. But, I'd like to get the widget IDs of all the children. Suppose:
base=widget_base(/col)
but=widget_button(base,value='top',/menu)
but1=widget_button(but,value='First level',/menu)
b11=widget_button(but1,value='First button',uval='firstbutton',group=but)
b12=widget_button(but1,value='Second button',uval='secondbutton',group=but)
but2=widget_button(but,value='First level',/menu)
b21=widget_button(but2,value='First button',uval='firstbutton',group=but)
b22=widget_button(but2,value='Second button',uval='secondbutton',group=but)
Now, I'd like to call something which will take as input the variable 'but' (as above) and return (in this example) a four element vector of widget IDs. I know widget_info(/child) but that only returns the first child. I suppose I could "nest" the group leaders, where the current button has the previous as a leader. Then just recursively call widget_info(/child), but that seems like a lot of work and requires the children be "serially" listed.
I've scoured the widget_info and widget_control pages. It really feels like this should not only be possible, but pretty simple. I must be missing something...
Any ideas?
Russell
|
|
|