Re: Base Widget PostCreation event [message #21941 is a reply to message #21937] |
Thu, 05 October 2000 00:00   |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
"Marcus O'Brien" <m.obrien@sghms.ac.uk> wrote
> The base widget is intended to be a reusable array sorting dialog for MR
> Images. It is called from an event occurring in its group leader base
widget,
> and passed the image array by UVALUE at that time. Once the base widget is
> called I want it to examine the array and initialize various aspects of
the
> dialog according to information gleaned.
I see, this is something I did more than once. I just can't figure out why
do you have to tie the array examination and base initialization to the
Creation of the widget base? It seems to me that in the same place where
that widget is created, initialization needs to occur first, since all data
can only be passed to the daughter base at that time anyway. Then, pass all
needed init info to the base and its daugter widgets and create them in the
normal order.
I guess the confusion stems from the attempt to have that base *reuseable*.
This means it exists somewhere hidden, but then you re-init it with some new
data. Is it worth it? For simplicity sake I'd say make a new modal sorting
dialog every time. It is not time consuming at all.
> My approach to this has been to look
> for a widget event like OnCreation or OnActive (I've previously used these
to
> initialize dialogs in motif) to start the initialization process.
>
> Thinking about it, OnCreate is the wrong place for the initialization and
an
> OnActive or OnMapped event would be the point where the widget had enough
> information to tailor itself for use.
>
> Widget_Control, /Send_event may well work.
If you insist on using the same base with its controls over and over, and it
does sit somewhere on your screen, in my Display program I use
Keyboard_focus events to detect when that base is clicked on. Every time a
base is brought to the foreground, it sends a got_focus event (check out the
online help - ih has that).
But if that base gets killed, you might as well init the data in the same
code where you make the base.
> Do widgets in idl still generate the same events as the underlying OS
> widgets. Is it just that Xmanager only picks up idl supported events?
Sorry, this is beyond my realm. I am not getting into the OS events, because
I want to be able to use my code regardless of the platform.
Cheers,
Pavel
|
|
|