creating a widget inside an existing widget [message #67175] |
Thu, 09 July 2009 21:07  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
Hi,
I am tying to add some code to my event handler program so that for
example each time "button1" is selected, a new widget-base inluding
some buttons and text is added to my existing widget. Can anybody
please help me how to do that? Is this at all possible?
In this way, each time "button1" is clicked and the new part is added
to the existing widget, it becomes bigger. Same as when we add a new
row to the bottom of a table; but this row has some buttons and text
inside it.
Thank you
b.a
|
|
|
Re: creating a widget inside an existing widget [message #67297 is a reply to message #67175] |
Sun, 12 July 2009 16:53  |
boshra afra
Messages: 2 Registered: July 2009
|
Junior Member |
|
|
On Jul 10, 11:08 pm, Bennett <juggernau...@gmail.com> wrote:
> On Jul 10, 1:18 am, "b.a" <u4565...@anu.edu.au> wrote:
>
>
>
>> On Jul 10, 2:31 pm, David Fanning <n...@dfanning.com> wrote:
>
>>> b.a writes:
>>>> I am tying to add some code to my event handler program so that for
>>>> example each time "button1" is selected, a new widget-base inluding
>>>> some buttons and text is added to my existing widget. Can anybody
>>>> please help me how to do that? Is this at all possible?
>
>>>> In this way, each time "button1" is clicked and the new part is added
>>>> to the existing widget, it becomes bigger. Same as when we add a new
>>>> row to the bottom of a table; but this row has some buttons and text
>>>> inside it.
>
>>> You might get away with something like this on Windows,
>>> but I seriously doubt you will get away with it in UNIX.
>>> Typically, if you want to add widgets after you have
>>> realized the widget hierarchy, you must destroy and
>>> recreate the hierarchy. (There are keywords and techniques
>>> you can use to recreate it in the same location as the old
>>> hierarchy, etc., but basically, you have to rebuild it.)
>
>>> I'm only about 80% sure of this answer. Changes in the
>>> way widget events are handled, etc., may have changed things.
>>> Let's just say, I would be surprised if you got this to work.
>
>>> Cheers,
>
>>> David
>
>>> --
>>> David Fanning, Ph.D.
>>> Fanning Software Consulting, Inc.
>>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>> Thanks for your reply David.
>> Actually I am writing the program using IDL workbench. The only way
>> that I can think of is to have some widgets on my top level base which
>> are initially sensetive =0, and then I might be able to make them
>> sensetive=1 in case of the event. I may try it!!
>
>> Cheers
>> b.a
>
> If you're willing to allocate the space needed in your main widget for
> all this business then MAP makes the widgets appear and reappear like
> magic...not really magic though...
> Sensitive also works if you just don't want someone to have the
> ability to click the button.
Hi Bennett,
I tried with sensetive and as you said, buttons and other widges don't
work in this way. But now,I got it to work and it is fine up to this
stage. Thanks.
|
|
|