Main Page | Report this Page
Linux Forum Index  »  Linux Development - Applications  »  gambas2: setting the window size for a newly started...
Page 1 of 1    

gambas2: setting the window size for a newly started...

Author Message
Mark Hobley...
Posted: Tue Nov 03, 2009 12:08 am
Guest
I am using gambas2 (which is a bit like a linux version of visual basic).

At the start of program, how do determine what size to set the application
window?

I believe that the following are factors to consider:

command line switches
users local configuration file
system configuration file
window manager default window size
size when application was last used (presumably window manager decides this)
X11 default window size if the window manager is not running
Hard coded default
Maximum limits

These are in order of precedence, so if I have command line switches, or
parameters in thr use local configuration file or the application system
configuration file, then I will use those.

However, what do I do next?

Does the window manager or X11 provide a default window size?
If so, how do I get my application to use the default size provided by
the window manager?

Can I do something like the following?

FMain.Width = Default
FMain.Height = Default

(There is no value for Default in the form designer, and it does not
allow me to set the window size to zero, so how would I obtain a
default?)

Are there any other factors to consider (not in my list of factors above)?

Also what does the AutoResize property do? Does it affect my window size
in any way and is it anything to do with any of the above?

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
 
Mark Hobley...
Posted: Tue Nov 03, 2009 2:08 pm
Guest
In alt.comp.lang.gambas Mark Hobley <markhobley at (no spam) hotpop.donottypethisbit.com> wrote:
Quote:
Are there any other factors to consider?
|
command line switches |
environmental variables <-----------


Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
 
Joe Pfeiffer...
Posted: Tue Nov 03, 2009 2:53 pm
Guest
markhobley at (no spam) hotpop.donottypethisbit.com (Mark Hobley) writes:
<snip>

Quote:
Are there any other factors to consider (not in my list of factors above)?

Typically (in an X application; I don't know this particular development
tool), you don't worry about any of this. You lay out your window to
take as much space as you need for the material it will contain, and let
the window manager worry about the actual size it gives it. A
"friendly" program announces how much window it wants, and accepts
whatever it is given.

Quote:
Also what does the AutoResize property do? Does it affect my window size
in any way and is it anything to do with any of the above?

Make sure your program is well-behaved if it gets less space than it
wants -- I've now got a laptop that's one small (heh heh) step up from a
netbook; since its screen resolution is only 1024x600, I've been apalled
at how many applications (including one I'm guilty of...) insist on a
taller window than is available on my laptop. Simply having automatic
scrollbars would have fixed them all.
--
As we enjoy great advantages from the inventions of others, we should
be glad of an opportunity to serve others by any invention of ours;
and this we should do freely and generously. (Benjamin Franklin)
 
Mark Hobley...
Posted: Tue Nov 03, 2009 5:08 pm
Guest
In alt.comp.lang.gambas Joe Pfeiffer <pfeiffer at (no spam) cs.nmsu.edu> wrote:

Quote:
Typically (in an X application; I don't know this particular development
tool), you don't worry about any of this. You lay out your window to
take as much space as you need for the material it will contain, and let
the window manager worry about the actual size it gives it. A
"friendly" program announces how much window it wants, and accepts
whatever it is given.

This is a kind of visual basic type of environment, where the windows
are drawn within the program editor.

I will programatically override such things as window sizes, colours,
and other stuff that has been set within the editor, to give the program
a more generic feel.

Quote:
Make sure your program is well-behaved if it gets less space than it
wants

Yeah, I will do this. The program will determine the screen size during
initialization, and will not exceed this.

I also have a policy of ensuring that applications will operate on a
standard (640 x 480) VGA display, so all default window sizes will be
within these limits.

http://markhobley.yi.org/policy/vga.html

Quote:
I've been apalled at how many applications (including one I'm guilty of...)
insist on a taller window than is available on my laptop. Simply having
automatic scrollbars would have fixed them all.

Yeah I hate that. I use point of sale terminals and touchscreens here
which typically have an 800 x 600 screen size.

When I used to use Microsoft Windows many of the applications ran
oversized. Since I migrated to Linux, the applications behave a lot
better, with most sticking within the screen size, although some do go
over (such as gimp).

Also Mozilla Firefox causes some websites to appear with content off
screen and applies scroll bars around the display area, so I have
to switch the stylesheets off sometimes.

In my applications, I am planning to scale the components to suit the
window size where practically possible, and provide configuration
options for all of the application display aspects.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sun Nov 29, 2009 12:32 pm