comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Base Widget PostCreation event
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Base Widget PostCreation event [message #21937] Fri, 06 October 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Marcus O'Brien (m.obrien@sghms.ac.uk) writes:

> In my previous use of widgets (X and Motif) I've tended to create everything
> first, then initialise and map as required by the event flow. Spose I ought to
> buy David's book if I'm going to use IDL widgets :-)

Oh, now *there* is an idea! :-)

And I've re-written all the widget programming chapters
just for you. The 2nd Edition officially goes on sale
November 1st, but I've been thinking of offering
my friends on the IDL newsgroup a special pre-sale
price. I'll probably make some kind of announcement
about it next week.

Cheers,

David

P.S. I'm teaching a course this week and we are
running IDL 5.4. When I went to show the folks how
to make a GIF file yesterday, I discovered that
you need a license to produce GIF files. I guess
Kodak is a target big enough to attact a suit from
Compuserve. Hello PNG files! :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Base Widget PostCreation event [message #21938 is a reply to message #21937] Fri, 06 October 2000 00:00 Go to previous message
Marcus O'Brien is currently offline  Marcus O'Brien
Messages: 16
Registered: October 2000
Junior Member
Thanks Pavel,

I'll take the route you've suggested, which seems more straight foreward and
has a reasonable chance of being platform independant.

> 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.
>

In my previous use of widgets (X and Motif) I've tended to create everything
first, then initialise and map as required by the event flow. Spose I ought to
buy David's book if I'm going to use IDL widgets :-)

Thanks again

Marc
Re: Base Widget PostCreation event [message #21941 is a reply to message #21937] Thu, 05 October 2000 00:00 Go to previous message
promashkin is currently offline  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
Re: Base Widget PostCreation event [message #21944 is a reply to message #21941] Thu, 05 October 2000 00:00 Go to previous message
Marcus O'Brien is currently offline  Marcus O'Brien
Messages: 16
Registered: October 2000
Junior Member
Hi,

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. 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.

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 if this is still unclear, but the RSI documentation on PostCreation led
me to believe that an event was generated after widget creation and all I
needed was to know the tag name to plug into the event handler.

Thanks

Marc

Pavel Romashkin wrote:

> I am sorry, I can't quite figure out what exactly do you want to do. Why
> do you have to have an OnCreate definition? Why not place the code to
> initialise a base widgets properties in your code, on the line *after*
> you create the widget - this would be an "after created" initialization.
> Also, Widget_Control, /Send_event may help if what you want is performed
> in your event handler.
> I wish I could be of more help but the task you are after is not clear
> to me. Give us some detail!
> Cheers,
> Pavel
>
Re: Base Widget PostCreation event [message #21950 is a reply to message #21941] Wed, 04 October 2000 00:00 Go to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
I am sorry, I can't quite figure out what exactly do you want to do. Why
do you have to have an OnCreate definition? Why not place the code to
initialise a base widgets properties in your code, on the line *after*
you create the widget - this would be an "after created" initialization.
Also, Widget_Control, /Send_event may help if what you want is performed
in your event handler.
I wish I could be of more help but the task you are after is not clear
to me. Give us some detail!
Cheers,
Pavel

Marcus O'Brien wrote:
>
> Hi,
>
> I'm trying to initialise a base widgets properties after it's been
> created and am unable to find an OnCreate event for the widget. The RSI
> documentation gives two differing stub definitions for the
> basewidget_eventcb.pro file, but seems to rely apon a PostCreation entry
> in the basewidget.pro file that has been created using GUIbuilder (Which
> seems to be absent on my Solaris version of IDL).
>
> Does any one know what the callback definition should be.
>
> Thanks
>
> Marc
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: storing ASCII_TEMPLATE templates for later use
Next Topic: Re: IDL PV-WAVE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:26:57 PDT 2025

Total time taken to generate the page: 2.08235 seconds