473,795 Members | 3,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default event handlers in wxPython

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 second part of it. Is
there some easy way of doing this?

I've not found one, so have set up the following for the menu:

self.Bind(wx.EV T_MENU_HIGHLIGH T, self.OnMenuHigh light)

def OnMenuHighlight (self, event):
self.SetStatusT ext(event.GetEv entObject().Get HelpString(even t.GetMenuId()),
1)

....this works fine. I've tried to set up the same for the toolbar:

self.Bind(wx.EV T_TOOL_ENTER, self.OnToolbarH ighlight)
def OnToolbarHighli ght(self, event):
self.SetStatusT ext(event.GetEv entObject().Get ToolLongHelp(ev ent.GetSelectio n()),
1)

....and this doesn't work. Well, it puts the text in the second part of the
toolbar as requested, but the default handler is still being called and
this messes up the first part of the toolbar which I want it to leave
alone. How do I completely override the default handler for the toolbar?
This method worked fine for menus and I'm a bit stuck.

(ignore the indentation on the above examples - I know it's wrong, but long
lines and usenet don't mix)
--
I'm at CAMbridge, not SPAMbridge
Jan 15 '07 #1
0 935

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

Similar topics

3
2888
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 also have a short look at the example below and give me some comments, please? Example:
2
2768
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 methods of the two libraries: app.MainLoop, and reactor.run. Additionally, the fact that wxPython was to receive requests from the twisted framework as well as the end user seemed to be simply asking for trouble. My initial solution was, naturally,...
10
3607
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script language="JavaScript" type="text/javascript"> function show(that) { if (box.style.visibility=='hidden') { that.style.visibility = 'visible'}; }
5
3574
by: Juan T. Llibre | last post by:
OK, guys, usually I answer questions instead of asking them, but this thing has me scratching my head. Why is the default for AutoEventWireup different for C# and VB.NET ? In VS 2005, if I create a new VB website using code-behind, the following Page directive is inserted : <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
16
2518
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 of properties or assign event handlers. I need to be able to clone the manipulated control at runtime. I could use the Clone method of some objects (like Font, Style, String,
14
8642
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 handlers are set like the old one. Is there a way to do this job? For example, is there a way to use EventInfo object to get all event handlers of the old control in runtime and set my new cloned control events to the event handlers of the old...
2
4244
by: crystalattice | last post by:
In my GUI app, I have a radio box allowing the user to pick his/her gender. When I click a button, I'd like the radio box to tell the program which choice is marked. I can get it to work when I manually pick a choice but I get an error when the choice is left at the default value, which is "Male". I have the radio box tied to an event to "see" when a choice is made, but how does it work if the person just leaves the default value? ...
7
1698
by: Erik Lind | last post by:
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...
3
2737
by: lee.walczak | last post by:
Hi, I have just started writing a GUI using wxpython after finding a limitation using Tkinter. I have read most tutorials on wxpython and slowly becoming accustomed considering I started with the latter GUI tool first! I must quote first that I am a novice user of python so the issue(s) I have may seem very obvious but please be patient with me! I have noticed that all the wxpython references I used for creating my
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.