Help!

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

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions RSS
Next:  [Samba] posix user mapped to window users without..  
Author Message
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Tue Nov 03, 2009 1:10 am    Post subject: gambas2: setting the window size for a newly started application
Archived from groups: alt>comp>lang>gambas, others (more info?)

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/
Back to top
Joe Pfeiffer
External


Since: Dec 21, 2004
Posts: 94



PostPosted: Tue Nov 03, 2009 12:53 pm    Post subject: Re: gambas2: setting the window size for a newly started application [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

markhobley RemoveThis @hotpop.donottypethisbit.com (Mark Hobley) writes:
<snip>

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

> 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)
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Tue Nov 03, 2009 3:10 pm    Post subject: Re: gambas2: setting the window size for a newly started application [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.comp.lang.gambas Mark Hobley <markhobley DeleteThis @hotpop.donottypethisbit.com> wrote:
>Are there any other factors to consider?
|
> command line switches |
environmental variables <-----------

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Tue Nov 03, 2009 6:10 pm    Post subject: Re: gambas2: setting the window size for a newly started application [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.comp.lang.gambas Joe Pfeiffer <pfeiffer RemoveThis @cs.nmsu.edu> wrote:

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

> 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

> 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/
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum