Object graphics on Windows [message #35321] |
Wed, 11 June 2003 15:24  |
MKatz843
Messages: 98 Registered: March 2002
|
Member |
|
|
Although I had hoped this day would never come, I've been forced by
flaky Linux hardware drivers to port my IDL GUI programs onto Windows
(2000). Everything was (is) developed on Mac OS X and normally runs on
a Linux machine--and I've never had any problems with that. So here I
am "slumming" on a 19th century operating system and I've got some
issues.
So far, I've overcome most of the minor hang-ups and have gotten the
programs to run, but the graphics look like hell, and I'm hoping to
get some advice. Here are some issues I've noticed right away.
1) All of my widget sizes are screwed up.
a) Asking for zero xpad, ypad, and space seems to fall on deaf ears
in widget_base(). You could go camping between some of my widget
bases.
b) widget_labels often cut off the text. I declare the widgets with
"xxx" and then fill them in when the widgets are realized. Do I need
to set everything to /Dynamic_Resize?
c) Requests to resize buttons after they are defined seem to be
ignored.
d) Dragging the corners of widget top-level bases to resize them
(with appropriate event handling routines) seems to be problematic at
best.
2) widget_draw widgets using object graphics and IDLgrImage objects
seem to leave a 2 or 3 pixel black edge at the tops of my widgets that
wasn't there on Mac or Linux. Do I have to change the viewplane_rect
to account for windows not being able to get the window size right? (I
have a lot of small buttons for which I use widget_draw objects. So a
3 pixel border really makes things look bad.) I like to use
single-pixel "Frames" on small widget_draw objects to separate them
from the background and give a nice 3-D edge. Could this be my
problem? Do Frames on Windows end up as black upper edges?
3) IDLgrFont sizes all need to be reduced by several points to have
the same appearance as they did on the other platforms. There seems to
be no special trick there except to check !version.os and set a
platform-dependent size.
I appreciate any advice from veterans of cross-platform GUI
development. Actually, I'm quite impressed that it works at all, and
even that it works pretty well so far. I just need to get the last few
percent of the solution. Are there rules of thumb that you use for
positioning object graphics and defining widget sizes?
I did notice one thing that Windows handles properly but the other
platforms don't: line thicknesses. IDLgrPolyline on Mac always seems
to be one pixel thick. Linux is mostly the same. On Windows the lines
can be a proper thickness.
Thanks,
M. Katz
|
|
|