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

Home » Public Forums » archive » Re: Loading picture into compound widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Loading picture into compound widget [message #31879 is a reply to message #31875] Tue, 27 August 2002 04:56 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Evgeny Turchin (evgturchin@narod.ru) writes:

> I want the picture which is opened when choosing "Open" item
> in "File" menu to be loaded into the draw widget but in my program
> it is loaded into a separate window. What should I change in my programs?
> Thanks in advance. I'm sorry for bothering the readers of the newsgroup
> with such simple thing.

Alas, using the GUI Builder to write widget programs
doesn't free you from the responsibility of knowing
what you are doing when you write GUI programs, it
just makes it much harder to read your code. :-)

The bottom line is this: you must know what window
you are drawing into when you write a widget program.
This means every widget program that draws graphics
*must* do a WSET to the window index number of the
window they want to draw into.

Your program does this, but not in the program
module where you are drawing your graphics! You need
a "WSET, index" in the ONOPEN procedure. But, as you
will no doubt discover, "index" isn't defined there,
but is defined in the BASE procedure.

Now you come upon the fundamental problem of widget
programming: information you need in one procedure
is actually stored or available somewhere else. The
GUI Builder's response to this is "Duh, I only *build*
widgets and write dumb widget code. I don't know anything
about making them work!"

My suggestion is to get ahold of a good IDL programming
book and read about "info" structures for passing information
required to run widget programs around in widget program
modules. Sooner or later it won't be just the index
that you need, you might actually want to do some work
on that image as well!

Cheers,

David

P.S. Let's just say putting all of the information you
need to run your program in one place and passing the
location of that place around to your widget program
modules is a MUCH better solution than common blocks!

Whoops! Does that sound like a pointer!? Oh, dear. We
are heading far afield now. :-(

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: new link for examples
Next Topic: replacement for insight

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

Current Time: Sun Oct 12 12:10:54 PDT 2025

Total time taken to generate the page: 1.20060 seconds