Re: Coyote graphics and resizeable draw widgets [message #79678 is a reply to message #79677] |
Fri, 23 March 2012 07:18  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Wayne Landsman writes:
> Coyote graphics allows one to display plots in a resizeable graphics window
> ( http://www.idlcoyote.com/graphics_tips/cgwindow.php ). While I
> don't often need a resizeable window for a single plot, I do often
> want to have a resizeable draw window for a plot in a widget
> application, where I can have buttons controlling the features of the
> plot. Creating a resizeable draw widget is currently quite
> tedious (http://www.idlcoyote.com/widget_tips/resize_draw.html )
> but it is not clear to me that the process can be simplified using
> Coyote graphics. Or can it?
Well, of course, it can. :-)
After fooling around with cgWindow for some time, I realized
that I wanted much of that functionality in another widget
program. Then I realized that most of the functionality
is already written as an object-widget, which is how I
normally write resizeable widget windows. So, about a
month ago I separated cgWindow from the underlying
object-widget, which I call cgCmdWindow.
If you look at the cgWindow code now, you will see that
it is nothing but a shell or "skin" to the underlying
cgCmdWindow code. The idea is that you can write
any kind of "skin" to the functionality that you like.
In other words, you can wrap that window up in its
own graphical user interface.
I haven't found a compelling reason to do this myself
yet, but I have no doubt that it is absolutely going
to work. ;-)
All you will have to do to add this to your widget
program is pass the cgCmdWindow the ID of its parent
widget. Then it's, well, done! Keep it's object reference
around so you can call its methods. It is really as
simple as that. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|