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


Groups > comp.lang.python > #11688

Re: monitor mouse coordinates in real-time

References <mailman.2262.1313311295.1164.python-list@python.org> <j289sm$m7g$1@speranza.aioe.org> <mailman.2279.1313340003.1164.python-list@python.org> <6e7d17a8-d5aa-4755-9bd4-09c09bed5c03@o26g2000vbi.googlegroups.com>
From Jabba Laci <jabba.laci@gmail.com>
Date 2011-08-17 17:20 +0200
Subject Re: monitor mouse coordinates in real-time
Newsgroups comp.lang.python
Message-ID <mailman.131.1313594477.27778.python-list@python.org> (permalink)

Show all headers | View raw


Hi,

Thanks, the problem got solved. The updated version can be found at
https://gist.github.com/1144708 in a comment below the original post.
Solution:

self.connect("destroy", self.quit)

def quit(self, widget):
        self.mouseThread.kill()
        gtk.main_quit()

It was not evident that quit() must be passed the argument "widget" too.

Thanks,

Laszlo


On Wed, Aug 17, 2011 at 16:48, MrJean1 <mrjean1@gmail.com> wrote:
> Check that the app.quit method registered with atexit is called.  E.g.
> on Windows, that may not be the case.
>
> /JeAN
>
>
> On Aug 14, 9:39 am, Jabba Laci <jabba.l...@gmail.com> wrote:
>> I'm trying something similar. In the thread there is a variable which
>> is modified by the parent. However, the thread doesn't quit the
>> infinite loop. If someone could provide a patch, that'd be really
>> useful.
>>
>> Thanks,
>>
>> Laszlo
>>
>>
>> On Sun, Aug 14, 2011 at 13:00, TheSaint <n...@nowhere.net.no> wrote:
>> > Jabba Laci wrote:
>>
>> >> Could you please help me out how to close the application correctly?
>>
>> > I think you should put a flag into the code, which the parent might modify
>> > it, so it will tell the child process to quit.
>> > Then the flag should need to be read periodically to know whether is time to
>> > quit.
>>
>> > --
>> >http://mail.python.org/mailman/listinfo/python-list
>
>

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


Thread

monitor mouse coordinates in real-time Jabba Laci <jabba.laci@gmail.com> - 2011-08-14 10:41 +0200
  Re: monitor mouse coordinates in real-time TheSaint <no@nowhere.net.no> - 2011-08-14 19:00 +0800
    Re: monitor mouse coordinates in real-time Jabba Laci <jabba.laci@gmail.com> - 2011-08-14 18:39 +0200
      Re: monitor mouse coordinates in real-time Jabba Laci <jabba.laci@gmail.com> - 2011-08-17 17:20 +0200

csiph-web