Best way to determine user's screensize?

Peter J. Holzer hjp-python at hjp.at
Sat Oct 31 07:47:02 EDT 2020


On 2020-10-30 19:18:22 -0500, Igor Korot wrote:
> On Fri, Oct 30, 2020 at 6:59 PM Peter J. Holzer <hjp-python at hjp.at> wrote:
> > On 2020-10-31 10:02:12 +1100, Chris Angelico wrote:
> > > I add my voice to those who detest applications that think they know
> > > best and decide that they own the entire screen.
> >
> > So, assuming the user is invoking the application for the first time,
> > how should an application determine how much of the screen it should
> > use? It has to make some choice, and any hard-coded value is almost
> > certainly wrong. So why should an application not use the screen size as
> > one factor?
> 
> It is not up to application.
> It is up to the underlying layout system to decide.

This only works if all the GUI elements are of fixed size. 

If you are writing a MUA, for example, there are several elements which
are essentially of arbitrary size: A list or tree of mailboxes. A list
(or forest) of mails in the current mailbox. A pane to display the
current mail. To size these properly you have to know what kind of
information is going to be displayed. Depending on the screen size it
may be better to only show one of them at a time. The application
programmer knows this. The layout system doesn't. This should also be
configurable by the user, which again means that the application has to
a) provide a configuration UI and b) has to be able to set the layout
the way the user configured it.

Layout systems are important and useful. But they are tools, they can't
do everything by themselves. In the end the application programmer has
to decide how to use them.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20201031/a38e8f7a/attachment-0001.sig>


More information about the Python-list mailing list