Best way to determine user's screensize?

Peter J. Holzer hjp-python at hjp.at
Fri Oct 30 18:46:25 EDT 2020


On 2020-10-30 16:31:25 -0500, Igor Korot wrote:
> On Fri, Oct 30, 2020 at 4:20 PM Random832 <random832 at fastmail.com> wrote:
> >
> > On Fri, Oct 30, 2020, at 12:05, Grant Edwards wrote:
> > > Why do you think that's something your application needs to know?
> > >
> > > I _hate_ applications that think just because they've been started
> > > they now own the entire computer and everything reachable from it.
> > >
> > > All you need to know is how big your application window is. The user's
> > > available screen size is none of your business.
> >
> > The application decides how big the application window is. The user
> > can resize it, but there's no reason for the screen size not to be
> > one of the inputs considered for the initial choice.
> 
> Nope.
> It is nNOT up to application.
> It is either up to the developer

The developer writes the application. The application doesn't decide to
do anything it hasn't been programmed to do. So saying "it is not up the
the application, it is up to the developer" doesn't make any sense.

Oh, and I just realized that "application" is ambiguous. It could mean
the program, or it could be what the program is used for. Of course the
developer should consider the latter when writing the former.

> (if he calls Maximize() ) on the main frame,

An application shouldn't do that unless explicitely directed to by the
user.

> or the OS if the main frame is using defaults.

I'm not sure if OS's even have a default window size. In any case, one
size doesn't fit all. There are many cases where the initial size should
depend on the application:

* A terminal emulator would make the window large enough for a typical
  terminal size (e.g. 80x25 characters) plus chrome.
* An image viewer would make it large enough for the image, but not
  larger than the screen (if the image is larger than the screen (quite
  probable for photos) it will be scaled down).
* A MUA would make it large enough for a list of mailboxes, a list of
  mails and one mail in some default pane configuration, but again not
  larger than the screen.
* A media player would make it large enough for the playlist and some
  chrome.

etc.

-- 
   _  | 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/20201030/63881a9a/attachment.sig>


More information about the Python-list mailing list