Re: labelsize in David Fanning's fsc_field, or choosing fonts for widgets [message #39306] |
Wed, 05 May 2004 10:20 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Benjamin Hornberger writes:
> do you know of any tricks to automatically determine a proper labelsize
> in David Fanning's fsc_field compound widget (which is a replacement for
> IDL's cw_field)?
>
> I want to set it specifically so that my fields align nicely under each
> other. However, if by trial and error I find a size for my Windows
> computer, the text is cut off if I run the program from a Linux computer
> through SSH and using Exceed as an X server (on the same Windows PC).
Oh, dear. You have just stumbled upon one of the most frustrating
aspects of IDL. (Well, other than getting decent PostScript output,
of course.) If you are as obsessive/compulsive as I am, the heeby-jeeby
interface offered by IDL widgets drives you nuts. It's nearly as
bad as helping your disorganized youngest son with his math
homework. :-(
You have two choices. Buy a piece of software designed by
someone who took an art class or two when he went to college
(not too many Humanities majors writing software, alas), or (more
likely) learn to appreciate complexity.
The first rule of widget programming, of course, is *never* to
size anything explicitly if you expect it to run on more than
one machine. But to make straight lines and produce order out
of chaos, you don't have much choice in the matter. You have
to size widgets.
I only know one way to do it: empirically. You just try it
a dozen different times until it looks right. And you have
to do this on *every* machine you plan to run it on. Once you
have determined the sizes, you have to write code that can
distinguish the various machines and set sizes accordingly.
It's a nightmare, no question about it. (Configuration files
are another alternative.)
CASE !Version.OS OF
'Win32': labelsize = 30
'IRIX' : labelsize = 50
ELSE : labelsize = 45
ENDCASE
> Alternatively, do you have any tricks for choosing proper fonts in
> Widget programs (maybe a platform-dependent choice) so that they look
> nice on different platforms?
Oh, don't even get me started with fonts. It's totally hopeless. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|