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

Home » Public Forums » archive » Re: Colors and Virtual Machine
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: Colors and Virtual Machine [message #49145] Mon, 03 July 2006 20:56 Go to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
> What version of IDL are you using?
I'm using 6.0, if that helps.

> Keep in mind that once a Visual is used to draw something or talk to the X
> server, that Visual must be used for the rest of the session and cannot be
> changed. Even "DEVICE, /HELP" can do this. So, *something* is getting in
> there and establishing the Visual before you can set it yourself. Right
> now, I don't know what it is. Still, knowing the release will help a bit
> here.

There must be something in the way VM is called that sets the device
visual. Maybe someone out there knows a way to tell VM which visual to
use.

> One thing you could try is reconfiguring your X server to not use
> DirectColor visuals.

I'll try that on my machine, but I was hoping to be able to package
this program, which means that other users would have to do the same
thing - more work than I want the end user to have to do.

One more thing- if I compile this thing in say IDL 6.2, will VM be able
to interpet the program correctly? i.e., if I compile it in 6.2, and a
user runs it in a IDL VM that is packaged with 6.0, will it find the
correct visual?

Oh those IDL blues . . .
Re: Colors and Virtual Machine [message #49147 is a reply to message #49145] Mon, 03 July 2006 14:58 Go to previous messageGo to next message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Mon, 03 Jul 2006 11:12:53 -0700, Phillip Bitzer wrote:

> Tried setting the True Color keyword, but no luck. Indeed, I am getting
> a DirectColor visual, but I can't seem to tell my program to get the
> TrueColor. By the way, the reason this happens in VM but not IDL is
> I've set the TrueColor keyword in my startup file. Anyway, here's the
> code (at least the beginnning):
>
> ;@satview_GUI_TLB_events
> ;@satView
> pro satview_GUI
> ;provides GUI wrapper for satView program
> device, true_color=24
> device, get_visual_name=state
> print, state
> ...
>
> I'd like to be able to compile those two files in the header as well,
> but I've commented them out until I get this to work. The result of
> "print, state" is DirectColor.
>
> Any ideas on what I'm doing wrong?

Philip,

What version of IDL are you using? IDL 6.2 contained a change where IDL
would start picking the TrueColor Visual over DirectColor by default.

There were also a lot of changes made to the way splash screens work in
releases prior to 6.2 that may address this. But I can't be more specific
without knowing what release is involved.

Keep in mind that once a Visual is used to draw something or talk to the X
server, that Visual must be used for the rest of the session and cannot be
changed. Even "DEVICE, /HELP" can do this. So, *something* is getting in
there and establishing the Visual before you can set it yourself. Right
now, I don't know what it is. Still, knowing the release will help a bit
here.

One thing you could try is reconfiguring your X server to not use
DirectColor visuals. This is pretty straightforward if you have an X.org
or XFree86 server.

Karl
Re: Colors and Virtual Machine [message #49148 is a reply to message #49147] Mon, 03 July 2006 11:12 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Tried setting the True Color keyword, but no luck. Indeed, I am getting
a DirectColor visual, but I can't seem to tell my program to get the
TrueColor. By the way, the reason this happens in VM but not IDL is
I've set the TrueColor keyword in my startup file. Anyway, here's the
code (at least the beginnning):

;@satview_GUI_TLB_events
;@satView
pro satview_GUI
;provides GUI wrapper for satView program
device, true_color=24
device, get_visual_name=state
print, state
...

I'd like to be able to compile those two files in the header as well,
but I've commented them out until I get this to work. The result of
"print, state" is DirectColor.

Any ideas on what I'm doing wrong?
Re: Colors and Virtual Machine [message #49152 is a reply to message #49148] Sun, 02 July 2006 05:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Phillip Bitzer writes:

> OK, IDL gurus, here's another question for you.
>
> I have created (with help from this news group and a couple of David
> Fanning's procedures) a GUI for a program that maps out data on map
> projection. It works great if I run it from IDL; nice color pic and the
> such.
>
> Problem I encounter is when I save it with IDL's save procedure, and
> run the program in IDL VM. I get a black and white pic. That is, until
> I mouse over a widget_draw widget. Then I get colors all over the
> place; the correct colors are in the draw widget, but I also get a
> skewing of colors elsewhere on the monitor.
>
> I'm sure I didn't include quite enough info, but I'm hoping this is a
> (somewhat) common problem that somebody has encountered before with
> some fix that I've overlooked.
>
> Any ideas?

I'm on a stolen Internet connection, so I have to be brief,
but I would try inserting a:

Device, True_Color=24

command as the very FIRST command in your program. I suspect
the virtual machine is getting a DirectColor visual, which
is NOT what you want! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Colors and Virtual Machine [message #49232 is a reply to message #49145] Wed, 05 July 2006 10:10 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Mon, 03 Jul 2006 20:56:07 -0700, Phillip Bitzer wrote:

> I'm using 6.0, if that helps.

Yep. Quite important in this context.

> There must be something in the way VM is called that sets the device
> visual. Maybe someone out there knows a way to tell VM which visual to
> use.

OK, I think I got to the bottom of this.

Your program:

device, true_color=24
device, get_visual_name=state
print, state

runs ok in the VM on IDL 6.2. It reports DirectColor on IDL 6.0.

I think that was a bug that has been fixed between 6.0 and 6.2. When you
start the VM, it displays a splash screen where you click that button to
start runing the app. This splash screen caused the visual to get set to
DirectColor, which was a bug. So, there was no way for the app to select
a visual when running under the VM.

> I'll try that on my machine, but I was hoping to be able to package
> this program, which means that other users would have to do the same
> thing - more work than I want the end user to have to do.

Yes, agreed. It's just a weak workaround.

> One more thing- if I compile this thing in say IDL 6.2, will VM be able
> to interpet the program correctly? i.e., if I compile it in 6.2, and a
> user runs it in a IDL VM that is packaged with 6.0, will it find the
> correct visual?

No, a 6.0 VM would still have the bug. Your users would have to upgrade
their VM's.

Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Thinning image morphological operator
Next Topic: Colors and Virtual Machine

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

Current Time: Wed Oct 08 19:21:08 PDT 2025

Total time taken to generate the page: 0.00554 seconds