Re: Widget frustration continues... [message #10001] |
Mon, 29 September 1997 00:00 |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Aviv Gladman wrote:
> Well, I've abandoned the hope of getting IDL to correctly map widget
> colors in either 24 or 8-bit mode (thanks for all the advice, though), but
> my list of other difficulties (features?!) continues to grow. Has anyone
> had any luck getting IDL to recognise Motif widget resources
> (SunOs5/Ultra/Openwin3.0/IDL/X)? I tried the sample code included in the
> 'RESOURCE_NAME keyword' manual entry, could not get any of the resources
> recognised (no accelerator, no background color, etc) even after using
> xrdb to reload my resource file and starting from a fresh X session.
My answer probably won't make you happy, but here goes.
I would like to strongly discourage you from using *any* custom X resources.
The reason is that while they might allow you to create fabulous looking
widget applications on *your* Sun console, I can guarantee that they will
look different on any other box where you care to run the application. And if
your application is any good, someone *will* want to run it on another
platform. One of IDL's strengths IMHO is the ability to create widget
applications that look essentially the same on any platform. However to do
this, you must be a little conservative as to how the widgets are created.
Regarding colors, I have to admit that using 24 bit color consistently and
well on all platforms has eluded me at this point. So in the spirit of KISS
(keep it simple stupid), I use the following IDL startup file which I've
found gives me consistent 8 bit graphics behavior on all Unix platforms:
;-------------------------------------------------
;- Set up 8 bit display and grab colors
if !version.os_family eq 'unix' then device, pseudo = 8
device, retain = 2, decomposed = 0
window, /free, /pixmap, colors = -5
plot, [ 0 ]
wdelete, !d.window
print, 'Number of colors is ', !d.n_colors
;- Set graphics and widget font sizes
device, set_character_size = [ 6, 9 ]
widget_control, default_font = '7x13'
;- ensure IDL 5.0 XMANAGER behavior is consistent with IDL 4.0
xmanager, catch = 0
;-------------------------------------------------
I still sometimes create pseudo 24 bit images, but I do them using COLOR_QUAN
so that I can remain happily in 8 bit mode.
Cheers,
Liam.
|
|
|