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

Home » Public Forums » archive » Re: GUI size on different screens
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: GUI size on different screens [message #51455] Sat, 25 November 2006 09:58 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
lory writes:

> How can I find which font and which character size are used by default
> (before changing it)?

You can't. :-(

(I put this out more as a challenge than as a statement of fact.
But, I have never discovered how to do it reliably.)

> My code should run under different OS, with
> different "system" font, and I would change only the size of the
> characters.

If you want your code to run under different operating systems,
leave fonts ALONE! Don't muck with them. Let the users use the
fonts they want to use. You are going down a path here that leads
to complete ruin and frustration!

> Another question: I do not fully understand the string you assigned to
> default_font, could you explain all the modifiers? The description of
> default_font in the IDL help is very short ...

This explanation will help only for users with a particular operating
system and for users who have this particular font installed. (Some
will and some, for whatever inexplicable reason, will not.) Take
everything you learn with a grain of salt, and IGNORE ALL ADVICE.
Leave fonts ALONE!

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: GUI size on different screens [message #51457 is a reply to message #51455] Sat, 25 November 2006 09:49 Go to previous messageGo to next message
lory is currently offline  lory
Messages: 6
Registered: November 2006
Junior Member
>
> widget_control,default_font='-adobe-courier-*-r-*--8-*
>

How can I find which font and which character size are used by default
(before changing it)? My code should run under different OS, with
different "system" font, and I would change only the size of the
characters.
Another question: I do not fully understand the string you assigned to
default_font, could you explain all the modifiers? The description of
default_font in the IDL help is very short ...

thanks again

lory
Re: GUI size on different screens [message #51471 is a reply to message #51457] Fri, 24 November 2006 08:44 Go to previous messageGo to next message
lory is currently offline  lory
Messages: 6
Registered: November 2006
Junior Member
thank you all for the sugestions !
I used both the scroll bars and a font size depending on the screen
resolution and now it is not too bad also on the lower resolution screen
Re: GUI size on different screens [message #51495 is a reply to message #51471] Fri, 24 November 2006 01:40 Go to previous messageGo to next message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
Lory,

While not a perfect solution, you can change the font size for all the
label widgets, text widgets etc. This can save a lot of space depending
on what sort of widgets you have (obviously it has no effect if it's
mostly draw widgets).

Something like:

widget_control,default_font='-adobe-courier-*-r-*--8-*

near the start of your code, assuming you're not explicitly giving fonts
to each widget. This will affect the size of most things (most widgets
have text on them in some form).

On linux, you can use "xfontsel" to see the different fonts available,
the example I gave above isn't very pleasing on the eye. Presumably a
similar thing exists on windows... something called "charmap" seems
familiar from distant memories but I really don't know.

Not ideal, but much quicker that re-writing all your code.

Thanks,

Allan

lory wrote:
> Hi,
> I developed a software in IDL with a large number of GUIs. The screen
> resolution of my PC is 1600x1200 and the GUIs are correctly sized for
> this kind of screen. I did not use explicit sizing of the widgets,
> since I need to use both linux and windows systems. Now, I installed my
> software on a laptop with a 1024x768 pixels screen and ... the software
> is totally useless since the GUIs are too large and go off the screen !
> Is there any simple solution to this problem? There is any way to
> resize characters, buttons and so on accordingly with the screen size?
> Please, I don't want to rewrite all the code to fit the 1024x768 pixels
> ! It's a lot of code !
>
> thanks
>
> lory
>
Re: GUI size on different screens [message #51503 is a reply to message #51495] Thu, 23 November 2006 18:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
lory writes:

> I developed a software in IDL with a large number of GUIs. The screen
> resolution of my PC is 1600x1200 and the GUIs are correctly sized for
> this kind of screen. I did not use explicit sizing of the widgets,
> since I need to use both linux and windows systems. Now, I installed my
> software on a laptop with a 1024x768 pixels screen and ... the software
> is totally useless since the GUIs are too large and go off the screen !
> Is there any simple solution to this problem? There is any way to
> resize characters, buttons and so on accordingly with the screen size?
> Please, I don't want to rewrite all the code to fit the 1024x768 pixels
> ! It's a lot of code !

You could always put scroll bars on your TLB. You won't
be able to see all the internal widgets, probably, but
you will be able to scroll to them and use them.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: GUI size on different screens [message #51507 is a reply to message #51503] Thu, 23 November 2006 11:29 Go to previous messageGo to next message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
There's no solution except to design for the smallest screen you plan
to use. Keep in mind also that the widget layout typically takes more
space on a linux machine.

You only have to change the layout code, though - nothing else. Maybe
you can group your controls onto tab widgets - that saves a lot of
space, and it's very easy to do.

regards,
Greg
Re: GUI size on different screens [message #51510 is a reply to message #51507] Thu, 23 November 2006 10:58 Go to previous messageGo to next message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
lory wrote:
> Hi,
> I developed a software in IDL with a large number of GUIs. The screen
> resolution of my PC is 1600x1200 and the GUIs are correctly sized for
> this kind of screen. I did not use explicit sizing of the widgets,
> since I need to use both linux and windows systems. Now, I installed my
> software on a laptop with a 1024x768 pixels screen and ... the software
> is totally useless since the GUIs are too large and go off the screen !
> Is there any simple solution to this problem? There is any way to
> resize characters, buttons and so on accordingly with the screen size?
> Please, I don't want to rewrite all the code to fit the 1024x768 pixels
> ! It's a lot of code !
>
> thanks
>
> lory

I had a similar problem with a rather large program that I've been
working off and on for the past several months. My solution was to
condense a set of buttons into a combobox. Not only is it easier to
expand the functionality of this particular set of buttons (an entry in
the combobox list and corresponding code inside the case statement in
the event handler for the combobox), but saved a surprising amount of
screen real-estate. The draw widget in the program was already set up
to size itself according to the screen resolution (some problems when
using multiple monitors pop up that I haven't been able to solve yet,
but hardcoding for the particular machine is a stop-gap).

Another option is multiple TLBs that have the same unmapped group
leader, but I don't find this particularly attractive for some cases.
Re: GUI size on different screens [message #51581 is a reply to message #51471] Mon, 27 November 2006 13:56 Go to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
lory wrote:
> thank you all for the sugestions !
> I used both the scroll bars and a font size depending on the screen
> resolution and now it is not too bad also on the lower resolution screen

One more suggestion that I haven't seen yet: when I really want to save
a few pixels, I set xpad=0 and ypad=0 in my calls to widget creation
functions. This packs them tighter, especially when I'm using many
nested widget_base's.

Mike
Re: GUI size on different screens [message #51584 is a reply to message #51455] Mon, 27 November 2006 12:12 Go to previous message
lory is currently offline  lory
Messages: 6
Registered: November 2006
Junior Member
Ok, I see that it is not the "correct" way... but how should I do to
develop programs in the "right" way with the goal that they could be
used under PC with different configuration?

When I started this project, I tried not using explicit sizing of
widgets because I realized that this can be a problem when the software
must be used under different OS and I want that my software could run
under both Windows and Linux (and something else ...). Very soon I
realized that it is not possible to write an IDL program really working
at the same way under different OS. Then when the program start, first
check which OS is running and then set some OS-dependent parameters to
manage OS-dependent feature. I would like to do something similar for
the screen resolution

I undestand that if I wrote the software optimizing it, for example,
for 1024x768, it would run even with resolution higher than that, but
it would not exploit the capabilities of high resolution screen
...Instead, I would like a software optimized for 1600x1200, but usable
with 1024x768, 1280x1024 etc. Scroll bars are a good suggestion, but is
there a way to know if the widget need a scroll bar? is there a way to
put a scroll bar only if the natural size of the widget is greater of
the screen size?
For example: I have GUIs that in high resolution take more or less 2/3
of the screen but in low resolution go off the screen. I want put a
scoll bar in the second case, but I don't want resize the GUIs in the
first case and I don't want check by hand every screen configuration to
decide if a scroll bar is required or not. I could do that in automatic
if I know the GUI size before realizing it, by comparing its natural
size with the screen size, but I don't know if it is possible.

thanks

Lory

David Fanning ha scritto:

> lory writes:
>
>> How can I find which font and which character size are used by default
>> (before changing it)?
>
> You can't. :-(
>
> (I put this out more as a challenge than as a statement of fact.
> But, I have never discovered how to do it reliably.)
>
>> My code should run under different OS, with
>> different "system" font, and I would change only the size of the
>> characters.
>
> If you want your code to run under different operating systems,
> leave fonts ALONE! Don't muck with them. Let the users use the
> fonts they want to use. You are going down a path here that leads
> to complete ruin and frustration!
>
>> Another question: I do not fully understand the string you assigned to
>> default_font, could you explain all the modifiers? The description of
>> default_font in the IDL help is very short ...
>
> This explanation will help only for users with a particular operating
> system and for users who have this particular font installed. (Some
> will and some, for whatever inexplicable reason, will not.) Take
> everything you learn with a grain of salt, and IGNORE ALL ADVICE.
> Leave fonts ALONE!
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Non maxima supression
Next Topic: A case where FOR loops are unavoidable?

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

Current Time: Wed Oct 08 15:16:16 PDT 2025

Total time taken to generate the page: 0.00653 seconds