Background monitoring of mouse events

Thought so, shame, C it is.

Cheers

Simon

Clinical Scientist
ACT
0121 627 1627 ex 53245

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: 05 May 2004 19:36
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Background monitoring of mouse events

Judge Simon wrote:

Hi,

I want to monitor mouse clicks to another program - is this possible
using the wx Mouse Event handlers???

In other words I want to make a simple app that runs in the background
and logs the time and location of every mouse click.

wxPython is too high-level of a toolkit. You need much lower level
access to the platform APIs and message queues to be able to do things
like this.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I am using :

    Python

2.3.3

    wxPython

2.4.2.4

While working on another project, I have discovered that items (like
wxStaticText , wxButton,…) that are created are automatically display
in the upper left corner of a panel, even thought they have not be
added.

See the example below. Around lines 11-13, 3 items are
created.

Even though they are not added to the frame (around line 27-28), they
still show up in the upper left corner of the frame (at least they do on
my PC).

Is this suppose to happen (designed default behavior – i.e. to let the
programmer know they forgot to add this item to a frame) ?

If not, what am I doing wrong…

BTW…I used the wxGlade to generate the original code just to make sure
I wasn’t screwing something up.

Thanks

Frank
···

======================================================

#!/usr/bin/env python

generated by wxGlade 0.3.1 on Thu May 06 13:06:55 2004

from wxPython.wx import *

class MyFrame1(wxFrame):

def __init__(self, *args, **kwds):

    # begin wxGlade:

MyFrame1.init

    kwds["style"] =

wxDEFAULT_FRAME_STYLE

    wxFrame.__init__(self, *args,

**kwds)

    self.label1 =

wxStaticText(self, -1, “test”)

    self.bCancel = wxButton(self,

wxID_CANCEL, “Cancel - Just Close Window”)

    self.tcToDelivery =

wxTextCtrl(self, -1, “”, style=wxTE_MULTILINE)

    self.__set_properties()

    self.__do_layout()

    # end wxGlade

def __set_properties(self):

    # begin wxGlade:

MyFrame1.__set_properties

self.SetTitle(“frame_2”)

    # end wxGlade

def __do_layout(self):

    # begin wxGlade:

MyFrame1.__do_layout

    sizer_3 =

wxBoxSizer(wxVERTICAL)

sizer_3.Add(self.label1, 0,

wxLEFT>wxTOP, 20)

    self.SetAutoLayout(1)

    self.SetSizer(sizer_3)

    sizer_3.Fit(self)

sizer_3.SetSizeHints(self)

    self.Layout()

    # end wxGlade

end of class MyFrame1

class MyApp(wxApp):

def OnInit(self):

    wxInitAllImageHandlers()

    frame_2 = MyFrame1(None, -1,

“”)

self.SetTopWindow(frame_2)

    frame_2.Show(1)

    return 1

end of class MyApp

if name == “main”:

app = MyApp(0)

app.MainLoop()

The items have the frame as parent, those that have a default size or have the size set will show up in the upper left corner unless you either hide them, move them via SetPosition or add them to a sizer.

···

On Thu, 06 May 2004 13:28:10 -0400, Frank Wilder <wilderf@ptd.net> wrote:

I am using :
         Python 2.3.3
         wxPython 2.4.2.4

While working on another project, I have discovered that items (like
wxStaticText , wxButton,...) that are created are automatically display in
the upper left corner of a panel, even thought they have not be added.

See the example below. Around lines 11-13, 3 items are created.

Even though they are not added to the frame (around line 27-28), they still
show up in the upper left corner of the frame (at least they do on my PC).

Is this suppose to happen (designed default behavior -- i.e. to let the
programmer know they forgot to add this item to a frame) ?

If not, what am I doing wrong...

BTW...I used the wxGlade to generate the original code just to make sure I
wasn't screwing something up.

Thanks
     Frank

--
Peter Damoc
Hacker Wannabe