Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8874

Re: Implicit initialization is EVIL!

References (2 earlier) <78624344-9696-42c9-9ed8-9454c55c1d9f@g12g2000yqd.googlegroups.com> <97ga0jFq2lU1@mid.individual.net> <4e131ef7$0$29977$c3e8da3$5496439d@news.astraweb.com> <4e133509$0$12858$426a74cc@news.free.fr> <999dd05c-cae5-4c86-8ee7-6e1d6116d2ed@gh5g2000vbb.googlegroups.com>
Date 2011-07-06 09:20 +1000
Subject Re: Implicit initialization is EVIL!
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.665.1309908056.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jul 6, 2011 at 8:42 AM, rantingrick <rantingrick@gmail.com> wrote:
> Chris are you playing devils advocate (for my team). I am confused? :-)

I say whatever I choose to say. Don't pigeon-hole me into "on your
team" or "not on your team" or "devil's advocate" or whatever. And at
two in the morning, "whatever I choose to say" can be quite random. :)

> On Jul 5, 11:00 am, Web Dreamer <webdrea...@nospam.fr> wrote:
>
>> What he means is that On Mac, if you close "all" windows, the application is
>> still running.
>
> Then that is NOT closing windows that is only ICONIFIYING/HIDING them.
> Let's use the correct lingo people!

Actually, it IS closing those windows. Why wouldn't it be?

1) User presses Alt-F4, or clicks the X, or opens the system menu and
chooses 'Close Window'.
2) Windowing manager sends a message to the appropriate thread's queue
(on MS Windows, that's WM_CLOSE; not sure how on Linux as I haven't
bothered to dig that deep - interface layers like Tkinter and GTK
don't count).
2a) Toolkit passes message to application code, if applicable.
3) Application destroys this window, leaving the other windows alive.

The memory used by that window can be reclaimed. Handles to its
objects are no longer valid. The window really is closed. The
application might not have terminated, but that window has not been
minimized - the *window* is closed.

> And how do you EXPLICITY quit the application? Because the interface
> for window management(on windows box) is three buttons "minimize",
> "maximize", and "destroy". If closing the window only "hides" the
> window then you are just "managing" a window's "visibility". We are
> talking about destroying GUI processes here.

Presumably you would right-click it and choose "Exit" or something. Up
to the application. If all else fails, kill -9 it.

The interface for window management does not actually have "destroy",
it has "close". The normal handling of a close message is to destroy
the window; and in many applications, once all windows have been
destroyed, the process terminates. These are three quite separate
concepts. The separation of "close" and "destroy" is most easily seen
in "Are you sure" prompts - you send a Close signal to the window, but
the application queries you before going through with the destruction.
And even once the last window has been destroyed, that has nothing to
do with process termination.

I could conceivably write a program that sits invisibly in the
background until a network message arrives. Upon receipt of such a
message, the program initializes the GUI subsystem and opens a window.
When the user closes the window, the program flushes all GUI code out
of memory and waits for the next message. While it's waiting, is there
any "main window" that exists but has just been hidden? No. But is the
application still running? Of course! Completely separate.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-03 15:11 -0700
  Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-04 08:21 +1000
    Re: Implicit initialization is EVIL! Roy Smith <roy@panix.com> - 2011-07-03 18:32 -0400
  Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-04 20:33 +1200
    Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-04 18:44 +1000
      Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 08:29 -0700
    Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 08:19 -0700
      Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-05 01:40 +1000
        Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 08:46 -0700
          Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-05 02:01 +1000
            Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 10:09 -0700
              Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-05 03:41 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 12:30 -0700
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-05 07:43 +1000
      Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-04 08:45 -0700
      Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-05 23:11 +1200
      Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-05 23:14 +1200
        Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 00:25 +1000
          Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-06 01:17 +1000
            Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 15:38 -0700
          Re: Implicit initialization is EVIL! Web Dreamer <webdreamer@nospam.fr> - 2011-07-05 18:00 +0200
            Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 15:42 -0700
              Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-06 09:20 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 16:47 -0700
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-06 09:54 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 17:15 -0700
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-06 10:34 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 18:10 -0700
              Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 18:12 +1200
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-06 06:51 -0700
                Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-07 00:32 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-06 08:10 -0700
                Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-07 02:11 +1000
                Re: Implicit initialization is EVIL! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 11:28 -0500
                Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-07 03:41 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-06 11:19 -0700
                Re: Implicit initialization is EVIL! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 13:36 -0500
                Re: Implicit initialization is EVIL! Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-06 13:15 -0600
                Re: Implicit initialization is EVIL! MRAB <python@mrabarnett.plus.com> - 2011-07-06 20:34 +0100
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-07 14:55 +1000
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-07 02:24 +1000
                Re: Implicit initialization is EVIL! "Waldek M." <wm@localhost.localdomain> - 2011-07-06 18:56 +0200
                Re: Implicit initialization is EVIL! Tim Chase <python.list@tim.thechases.com> - 2011-07-06 12:37 -0500
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-07 03:46 +1000
                Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-07 17:34 +1200
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-07 10:29 -0700
                Re: Implicit initialization is EVIL! Chris Angelico <rosuav@gmail.com> - 2011-07-08 04:24 +1000
                Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-08 11:25 +1000
                Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-08 10:30 -0700
                Re: Implicit initialization is EVIL! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-09 14:41 +1000
                Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-08 13:58 +1200
                Re: Implicit initialization is EVIL! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-07 13:42 -0500
        Re: Implicit initialization is EVIL! rantingrick <rantingrick@gmail.com> - 2011-07-05 15:47 -0700
          Re: Implicit initialization is EVIL! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 18:29 +1200
  Re: Implicit initialization is EVIL! Robin Becker <robin@reportlab.com> - 2011-07-04 16:35 +0100
    Re: Implicit initialization is EVIL! nn <pruebauno@latinmail.com> - 2011-07-05 08:33 -0700
      Re: Implicit initialization is EVIL! Robin Becker <robin@reportlab.com> - 2011-07-05 17:23 +0100

csiph-web