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

Home » Public Forums » archive » Object graphics on Windows
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
Object graphics on Windows [message #35321] Wed, 11 June 2003 15:24 Go to next message
MKatz843 is currently offline  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
Re: Object graphics on Windows [message #35437 is a reply to message #35321] Thu, 12 June 2003 14:45 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.195267e5778efd20989685@news.frii.com...
> And it is always amusing to see a lone button widget
> pop up in the middle of nowhere, followed seconds later by
> the rest of the user interface.

The Inverse Cheshire Cat Effect.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Object graphics on Windows [message #35441 is a reply to message #35321] Thu, 12 June 2003 10:35 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> Despite the oft-misinformed outlook of Windows users, who have been
> hardened by enduring years of incompatible OS upgrades, the various
> different linux distributions are actually, for the most part, just
> different flavors of exactly the same thing, diverging most notably in
> GUI themes and control tools.

And if I didn't know better, I would bet it is exactly
these "GUI themes and control tools" that make resizing
widgets "problematical". :-)

Of course, it is really the whole notion of "cross-compatibility"
that makes any GUI representation problematical. I have noticed
that I have even more problems (it seems) when I incorporate
widgets into objects. The problem seems to be systematic, rather
than the result of my typical boneheaded programming style, since
I've seen manifestations of it popping up in the strangest
places (e.g., in IDL 6.0). For the most part it seems
harmless. And it is always amusing to see a lone button widget
pop up in the middle of nowhere, followed seconds later by
the rest of the user interface.

Cheers,

David

P.S. Let's just say a course in alchemy would have been
handy for dealing with the the day to day trials and
tribulations of widget objects. :-)

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Object graphics on Windows [message #35442 is a reply to message #35321] Thu, 12 June 2003 09:47 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 12 Jun 2003 09:20:30 -0700, James Kuyper wrote:

> Paul van Delst wrote:
> ...
>> Isn't there a difference between the "open source linux" (whatever that
>> means) and the stuff that's distributed from companys like Red Hat and
>> Co.? (I don't know since I also will freely admit that I don't know
>> what I'm talking about :o)
>
> Yes and no. RedHat packages up Linux, and adds some "value added" to
> justify charging you a price for it, but it's basically the same thing
> you could download for free if you have a very fast modem or lots of
> time to spare.


Despite the oft-misinformed outlook of Windows users, who have been
hardened by enduring years of incompatible OS upgrades, the various
different linux distributions are actually, for the most part, just
different flavors of exactly the same thing, diverging most notably in
GUI themes and control tools. Most programs depend on the underlying
distribution primarily through shared libraries, with perhaps a weak
dependency on a shell for install scripts. Sometimes these
dependencies are very complex, and thus a program can seem tied to
individual distributions (RedHat 7.x, say). In reality, it's just
tied to a specific (large) combination of shared libraries.

The key point here is that IDL doesn't actually depend in the least on
all those RedHat extras; in fact it's fairly self-sufficient (bundling
it's own Mesa OpenGL library, for instance). It's dependencies are
limited to the C library (glibc), C++ library (libstdc++) and several
X11 libraries. So really, RSI could simply specify a range of glibc,
libstdc++, and XFree86 versions, and be confident that *any*
distribution with compatible versions will work. This is the standard
practice in the open-source world, but I suppose there's fear of
confusing the potential buyer.

JD
Re: Object graphics on Windows [message #35443 is a reply to message #35321] Thu, 12 June 2003 09:20 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Paul van Delst wrote:
...
> Isn't there a difference between the "open source linux" (whatever that means) and the
> stuff that's distributed from companys like Red Hat and Co.? (I don't know since I also
> will freely admit that I don't know what I'm talking about :o)

Yes and no. RedHat packages up Linux, and adds some "value added" to
justify charging you a price for it, but it's basically the same thing
you could download for free if you have a very fast modem or lots of
time to spare.
Re: Object graphics on Windows [message #35444 is a reply to message #35321] Thu, 12 June 2003 09:09 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
>
> Paul van Delst writes:
>
>> RSI only supports IDL under Red Hat? Wow - I wasn't aware of that. Isn't SuSE one of the
>> more popular linux distros out there? The only reason I ask is because there has been some
>> (v. cheap) talk about using SuSE here rather than Red Hat ("here" is being used in as
>> nebulous a mamner as possible). I'm positive it won't happen - but the fact that the words
>> even came up in a meeting amazed me (it is a gov installation after all :o).
>
> I don't have any idea what the support policy is, but

I went to the RSI website but after 5 minutes of hunting around I couldn't find anything.
The little CD-ROM cover with the latest version I have (5.5) only lists Red Hat under
linux.

> I can believe RSI only *tests* IDL on Red Hat. Here
> you see the down side of open software. Anybody and
> his brother can be in there tinkering under the hood.

Isn't there a difference between the "open source linux" (whatever that means) and the
stuff that's distributed from companys like Red Hat and Co.? (I don't know since I also
will freely admit that I don't know what I'm talking about :o)

> Should a software manufacturer have to hire a squadron
> of technical support engineers to support *everyone's*
> wild hare ideas? I don't think so.

Umm... most do don't they? I've been browsing the web looking for a new Fortran 95
compiler and for the one I've decided on the *supported* distributions include Debian, Red
Hat, Mandrake, Slackware, and SuSE. And various versions of each to boot.

To be fair, I think that a compiler is probably an easier thing to make portable than a
complex application like IDL (drivers and whatnot spring to mind).

paulv

> P.S. Don't bother to flame me. I already admitted I
> don't know what the hell I'm talking about. :-)

No flames here. I use Red Hat so IDL works flawlessly for me :o) Especially now I do the
COMPILE_OPT STRICTARR thingo.... har har. Ehem...

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
Re: Object graphics on Windows [message #35445 is a reply to message #35321] Thu, 12 June 2003 08:29 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> RSI only supports IDL under Red Hat? Wow - I wasn't aware of that. Isn't SuSE one of the
> more popular linux distros out there? The only reason I ask is because there has been some
> (v. cheap) talk about using SuSE here rather than Red Hat ("here" is being used in as
> nebulous a mamner as possible). I'm positive it won't happen - but the fact that the words
> even came up in a meeting amazed me (it is a gov installation after all :o).

I don't have any idea what the support policy is, but
I can believe RSI only *tests* IDL on Red Hat. Here
you see the down side of open software. Anybody and
his brother can be in there tinkering under the hood.
Should a software manufacturer have to hire a squadron
of technical support engineers to support *everyone's*
wild hare ideas? I don't think so.

Cheers,

David

P.S. Don't bother to flame me. I already admitted I
don't know what the hell I'm talking about. :-)

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Object graphics on Windows [message #35446 is a reply to message #35321] Thu, 12 June 2003 08:09 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
savoie.s.p.a.m.@nsidc.org wrote:
>
> David Fanning <david@dfanning.com> writes:
>
>> M. Katz writes:
>>
>>> 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.
>
>>> d) Dragging the corners of widget top-level bases to resize them
>>> (with appropriate event handling routines) seems to be problematic at
>>> best.
>>
>> Uh, well, I've never found it problematic, but I'll take your
>> word for it. :-)
>
> Well, I've had incredible problems with this on linux, but because I'm
> running a "non supported" linux, SUSE8.0, they will not file a bug report.
> So if you are lucky enough to be running the right version of Red Hat, maybe
> you can file this as a bug.

RSI only supports IDL under Red Hat? Wow - I wasn't aware of that. Isn't SuSE one of the
more popular linux distros out there? The only reason I ask is because there has been some
(v. cheap) talk about using SuSE here rather than Red Hat ("here" is being used in as
nebulous a mamner as possible). I'm positive it won't happen - but the fact that the words
even came up in a meeting amazed me (it is a gov installation after all :o).

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
Re: Object graphics on Windows [message #35448 is a reply to message #35321] Thu, 12 June 2003 07:44 Go to previous message
savoie.s.p.a.m. is currently offline  savoie.s.p.a.m.
Messages: 1
Registered: June 2003
Junior Member
David Fanning <david@dfanning.com> writes:

> M. Katz writes:
>
>> 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.

>> d) Dragging the corners of widget top-level bases to resize them
>> (with appropriate event handling routines) seems to be problematic at
>> best.
>
> Uh, well, I've never found it problematic, but I'll take your
> word for it. :-)

Well, I've had incredible problems with this on linux, but because I'm
running a "non supported" linux, SUSE8.0, they will not file a bug report.
So if you are lucky enough to be running the right version of Red Hat, maybe
you can file this as a bug.


> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155

--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
Re: Object graphics on Windows [message #35467 is a reply to message #35321] Wed, 11 June 2003 16:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
M. Katz writes:

> 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.

Oh, oh. Here we go. :-(

> 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.

Yeah. You could have taken one look at Bill Gates' house
and realized "small and compact" wasn't in his vocabulary.
He likes things spread out. He's an American who lives in
the big open space of the American West. What can I say?

> 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?

Yes, if your technique is to fill them *after* they are realized,
you better set everything to Dynamic_Resize. Othersize, what
you see is what you get. :-)

> c) Requests to resize buttons after they are defined seem to be
> ignored.

Yes, this one gave me a couple of interesting hours recently.
Apparently requests to change button sizes are ignored unless
the DYNAMIC_RESIZE keyword is also set for the button. Go figure.

> d) Dragging the corners of widget top-level bases to resize them
> (with appropriate event handling routines) seems to be problematic at
> best.

Uh, well, I've never found it problematic, but I'll take your
word for it. :-)

> 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?

I don't really understand this question. A draw widget
in Windows does have a 2-3 pixel "border" around the
canvas area of the draw widget. In other words, the screen
size of the draw widget is about 6 pixels larger than the
actual drawable area of the draw widget. Maybe this is what
you are seeing.


> 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.

There is no trick. It's trial and error. You wouldn't
believe some of the algorithms I've seen! In general,
you get around this by explicitly NOT sizing widgets that
contain text. Let them size themselves.

> 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?

Rules of thumb!? I always make sure I put this somewhere in
the documentation: "Don't call me. I'll call you."

> 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.

Hooray!

Cheers,

David

P.S. I'm pretty sure all these problems will be solved in IDL 6.0. :^)

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ION_IMAGE 8bit/24bit color
Next Topic: how did this happen?

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

Current Time: Fri Oct 10 21:11:40 PDT 2025

Total time taken to generate the page: 1.28132 seconds