473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

A question about event handlers with wxPython

I'd appreciate any pointer on a simple way to tell within an event handler
where the event came from.
I want to have "while" condition in a handler to stop or change processing
if an event occurs from some other button click.

Trying to bind more than one event to the same handler still doesn't tell me
where the event came from in a basic bind. Is there an argument I can put in
the bind so as to identify the source of the event in the event argument? .

Jan 15 '08 #1
7 1684
Hello Eric,
I'd appreciate any pointer on a simple way to tell within an event handler
where the event came from.
def HandleSomething(self, event):
generating_control = event.GetEventObject()
print generating_control

HTH,
--
Miki Tebeka <mi*********@gmail.com>
http://pythonwise.blogspot.com
Jan 15 '08 #2
def HandleSomething(self, event):
generating_control = event.GetEventObject()
print generating_control

HTH,
Thank you.That is what I was looking for, but as often seems the case, one
thing exposes another. Is there any way to listen for events without
specifically binding to a handler (it seems one cannot bind an event to two
handlers?)? One could do so with globals, but I'm trying to avoid that.

For example, "press any button to stop"
def HandleSomething(self, event):
.................
while generating_control: == something:
run
else
stop
Jan 15 '08 #3
On Jan 15, 9:04 am, "Erik Lind" <el...@spamcop.netwrote:
def HandleSomething(self, event):
generating_control = event.GetEventObject()
print generating_control
HTH,

Thank you.That is what I was looking for, but as often seems the case, one
thing exposes another. Is there any way to listen for events without
specifically binding to a handler (it seems one cannot bind an event to two
handlers?)? One could do so with globals, but I'm trying to avoid that.

For example, "press any button to stop"

def HandleSomething(self, event):
.................
while generating_control: == something:
run
else
stop
I forgot to provide a link to a fairly straight-forward explanation of
event propagation on the wxPython wiki: http://wiki.wxpython.org/EventPropagation

Hope that helps!

Mike
Jan 15 '08 #4
That all looks cool. I will experiment more. I'm a bit slow on this as only
two weeks old so far.

Thanks for the patience
Jan 15 '08 #5
On Jan 15, 2:20 pm, "Erik Lind" <el...@spamcop.netwrote:
That all looks cool. I will experiment more. I'm a bit slow on this as only
two weeks old so far.

Thanks for the patience
No problem. I'm pretty slow with some toolkits too...such as
SQLAlchemy. Ugh.

Mike
Jan 15 '08 #6

"Mike Driscoll" <ky******@gmail.comwrote in message
news:05**********************************@c4g2000h sg.googlegroups.com...
On Jan 15, 2:20 pm, "Erik Lind" <el...@spamcop.netwrote:
>That all looks cool. I will experiment more. I'm a bit slow on this as
only
two weeks old so far.

Thanks for the patience

No problem. I'm pretty slow with some toolkits too...such as
SQLAlchemy. Ugh.

Mike
BTW,

The wxPython group that you mentioned....is that
http://wxforum.shadonet.com/ ?

Jan 16 '08 #7
On Jan 16, 12:45 pm, "Erik Lind" <el...@spamcop.netwrote:
"Mike Driscoll" <kyoso...@gmail.comwrote in message

news:05**********************************@c4g2000h sg.googlegroups.com...
On Jan 15, 2:20 pm, "Erik Lind" <el...@spamcop.netwrote:
That all looks cool. I will experiment more. I'm a bit slow on this as
only
two weeks old so far.
Thanks for the patience
No problem. I'm pretty slow with some toolkits too...such as
SQLAlchemy. Ugh.
Mike

BTW,

The wxPython group that you mentioned....is thathttp://wxforum.shadonet.com/ ?
I think those are C++ users using the pure C++ wx. I meant the
following:

http://wxpython.org/maillist.php

Mike
Jan 16 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
Hello list, could somebody point me to a good reference about wxPython event handling? I have seen many examples but which one is the best. Waht are the advantages and disadvantages? Can you...
2
by: Daniel Bickett | last post by:
Hello, I am writing an application using two event-driven libraries: wxPython, and twisted. The first problem I encountered in the program is the confliction between the two all-consuming...
8
by: Dennis C. Drumm | last post by:
I have a class derived from a SortedList called SystemList that contains a list of objects indexed with a string value. The definition of the objects contained in the SortedList have a boolean...
6
by: iclinux | last post by:
I have to build a GUI applicaiton that could run on different OS such as windows and *nix, which GUI toolkit is better? Best Regards.
16
by: Hamed | last post by:
Hello I am developing a utility to be reused in other programs. It I have an object of type Control (a TextBox, ComboBox, etc.) that other programmers use it in applications. they may set some...
14
by: Hamed | last post by:
Hello It seems that I should implement ICloneable to implement my own clone object. the critical point for me is to make a control object based on another control object that all of its event...
0
by: Tom Wright | last post by:
Hi all I'm writing my first wxPython app and am having a problem with event handlers. I've set up a multi-part status bar and would like all the tooltips, menu help strings etc. to go into the...
2
by: dudds | last post by:
Hi I really haven't used wxPython before and I was just wondering if there was some sort of timer event that can be used. For example if I have a database that I want to query at regular intervals...
8
by: Tony Johansson | last post by:
Hello! I wonder can somebody explain when is it suitable to use these methods OnKeyUp, OnKeyDown and OnKeyPress because these raise an event. These are located in class UserControl. If these...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.