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

Home » Public Forums » archive » Re: Resetting a DRAW widget to have new size/scroll area...?
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: Resetting a DRAW widget to have new size/scroll area...? [message #3003] Tue, 01 November 1994 07:53
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <Pine.SOL.3.91.941031170641.8872A-100000@chroma>,
Russ Welti <rwelti@chroma.mbt.washington.edu> wrote:
> I have an application with one main window, which has one
> drawing area, into which I TV images. Does anyone know:
>

...

> I have tried DESTROYING and rebuilding the draw widget, but with
> only partial success at best. This is probably what I would do in X
> Windows...
>

And more than likely the way to do it in IDL widgets, too.

> Does anyone know if it is even possible to destroy and replace widgets
> from a realized, event-looping application?

Yeah, it's very possible. It takes only a dozen lines of code or so to
destroy, rebuild it and tie it back into the application.

> When I do it, the window
> does a quick shrink and resize; but a tv to the new draw widget has
> no effect, and things get worse from there.

Sounds like you may have forgotten to "wset" the new window ID to the
new draw widget. A piece of code for doing that would be something
like:

Widget_Control, drawwin, Get_Value=wid
WSet, wid

If you don't mind showing a little code one or more of us can probably
straighten out the problem with less guesswork. Or you can email it if
you want a smaller audience.

>
> My interim working solution at the moment is to destroy the entire
> BASE widget and rebuild the app from scratch, as if it was the first
> invocation. This is a bit disconcerting, as the app disappears for a
> few seconds, and one wonders if it crashed... ;)

Would it make things easier if the drawing widget hierarchy were
separate from the rest of the interface? That's also possible to do.
That way you can destroy and rebuild the drawing hierarchy without the
rest of the interface being affected at all. I think it looks cleaner,
but it may not lend itself to your application.

Mike Schienle Hughes Santa Barbara Research Center
8015@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
Re: Resetting a DRAW widget to have new size/scroll area...? [message #3005 is a reply to message #3003] Tue, 01 November 1994 04:40 Go to previous message
zawodny is currently offline  zawodny
Messages: 121
Registered: August 1992
Senior Member
In article <Pine.SOL.3.91.941031170641.8872A-100000@chroma> Russ Welti <rwelti@chroma.mbt.washington.edu> writes:
> I have an application with one main window, which has one
> drawing area, into which I TV images. Does anyone know:
> (snip)
> I have tried DESTROYING and rebuilding the draw widget, but with
> only partial success at best.
> (snip)
> ... When I do it, the window
> does a quick shrink and resize; but a tv to the new draw widget has
> no effect, and things get worse from there.
>
> Russ Welti


I agree that what you describe should work in principle and I am just about
ready to begin working on a similar piece of code myself. If you do indeed
need to destroy the widget to get the resize to work then all of the widget
id's will change upon recreation. The you will need to do the following:

widget_control,root,/realize
widget_control,get_value=window,draw_widget_id
wset, window

again. Since destroying the widget in my application would cause the loss
of all the information stored in UVALUES I guess that the best solution for
such an application would be to create a separately realized widget that
contains the draw widget by itself. That way destroying and creating these
would not force the loss of data (or use of common blocks) and would let
the user know that the application did not crash (since the "control panel"
widget would still exist and respond).

Good Luck,
--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681-0001
TCP/IP: ko4lw@ko4lw.ampr.org Packet: ko4lw@n4hog.va.usa
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Bug in map_set IDL3.6.1?
Next Topic: VAX floats to IEEE (source code avail.)

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

Current Time: Wed Oct 08 13:32:33 PDT 2025

Total time taken to generate the page: 0.00738 seconds