Re: Associating color-table with widget application [message #8806 is a reply to message #8754] |
Mon, 28 April 1997 00:00   |
Phil Williams
Messages: 78 Registered: April 1996
|
Member |
|
|
David Fanning wrote:
>
> David Foster <foster@bial1.ucsd.edu> writes:
>
>> The problem is simple: in a widget application, I want the widget to
>> load its own color-table whenever the cursor is "in" the application,
>> and load a pre-existing color-table when the cursor is "out" of the
>> application. Sounds easy right? Please tell me it is...what keyword
>> did I miss this time?
>>
>> I tried using tracking events, but you get color-flashing whenever
>> you leave one widget and enter another, even if you enable tracking
>> events for ALL widgets. If you enable tracking events for only the
>> TLB, you lose your colors whenever you move into, say, a slider
>> widget which adjust a plot which you really need to see in the
>> correct colors...
>
> Hi David. I think you are right to be thinking about color "protection",
> especially as we move into IDL 5 and an accessable command line
> while widget programs are running. I've been giving this idea
> a lot of thought, too. (See the new example programs that I
> put I my web page overnight.)
>
> But I guess I don't fully understand the problem you are having.
> I don't, for example, seem to have problems when I move into
> a slider. Perhaps because I have been taking a different
> approach. My idea is that each widget program ought to
> "know" its own colors, but be unconcerned with everyone
> else's colors. This way, when you enter a widget (via
> tracking on the TLB or a draw widget [although tracking
> on TLBs seems to be broken in the IDL 5 beta]) the widget
> program can restore its colors. This is what I mean by
> color protection.
>
> You necessarily have color flashing as you move from
> one widget to another, since the various widgets
> are using the same color indices, but I don't find it
> annoying in the slightest. In fact, it is exactly what
> I want!
>
> Anyway, perhaps an example of what you are stuggling
> with will help us find a solution.
>
> Cheers!
This is exactly what I do in my XDISPLAY program. I have one app that I
can have as many as 10 XDISPLAYs opened and each has it's own color
table. As the mouse moves into one XDISPLAY the LUT is updated w/ that
colors and all the olthers follow.
If you need to have more than one LUT at a time then you need to split
the color table. XDISPLAY can also do this (on a limited basis) by using
"greyscale/color" mode.
see http://www.irc.chmcc.org/idl/xdisplay.html for more info.
Phil
--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://scuttle.chmcc.org/~williams/
/*********************************************************** ********/
|
|
|