473,549 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wxPython:event. Skip() - watch out for stack depth

bartonc
6,596 Recognized Expert Expert
When calling methods in wxPython which are intended to extend the fuctionality of an event handler, it appears as though one must take stack depth in to consideration. For example, I tried:
Expand|Select|Wrap|Line Numbers
  1. #
  2.     def CloseSession(self, event):
  3.         sib = self.sibbling
  4.         pos = self.GetPosition()
  5.         sib.Move(pos)
  6.         sib.Show()
  7.         self.Hide()
  8.         ### allow event processing to continue here ###
  9.         event.Skip()
  10.  
  11.     def OnFeatureDialogClose(self, event):
  12.         self.CloseSession(event)
which seems like it should work, but doesn't.
So use:
Expand|Select|Wrap|Line Numbers
  1. #
  2.     def CloseSession(self):
  3.         sib = self.sibbling
  4.         pos = self.GetPosition()
  5.         sib.Move(pos)
  6.         sib.Show()
  7.         self.Hide()
  8.  
  9.     def OnFeatureDialogClose(self, event):
  10.         self.CloseSession()
  11.         ### allow event processing to continue here ###
  12.         event.Skip()
to get the correct internal reaction to the wx.EVT_CLOSE.
Jan 15 '07 #1
0 7339

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2870
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
2743
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...
8
5114
by: Jan Danielsson | last post by:
Hello all, I wanted to plot some statistics, so I wrote a simple wxPython class to do it. Then I realized that I would like to draw bar graphs, so I added that too. Since I'm a complete Python newbie, I haven't done much of it the "Python way", I suspect. So, I'm wondering if someone would like to show me some of the tricks I should have...
0
1480
by: Stefanie Wagner | last post by:
Hello, I am fighting with EVT_KILL_FOCUS for quite a time now and I don't succeed at all. Situation: If a user leaves a textfield the entered information should be checked and an additional window should be opened to make a search possible to complete the entry. Basic solution:
0
1427
by: Conrad | last post by:
Greetings, For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie Windows) to the next (ie Linux)? Specifically, I have a convience aggregate class that combines a wxStaticText with a wxComboBox, as I often need...
0
1140
by: gopython | last post by:
Hi, I just started coding with wxPython. The idea is to be able to change the gui dynamically. I am trying to change the static text inside the panel after the panel is created without user input/interaction, and I am not very successful with it. Below is my codes: import wx class MyForm (wx.Panel): def __init__ (self, parent, id):...
5
3853
by: dynamo | last post by:
Hi everyone.I'm new to wxpython.And i have a little problem.I tried to run the following wxpython app code in IDLE for python25: import wx import os import re def z(a): for i in range(1,13): return i*a class Mine(wx.Frame): def __init__(self,parent,id,title,pos,size,):
4
2262
by: analfabete | last post by:
Hi everybody! I really need your help I have created a program with events. So when my event is turn on by click on a menu , the parent windows move: My code: class MenuOptions(wx.Menu): def __init__(self, WinName): wx.Menu.__init__(self) self.parent = FenetrePrincipal( None, -1, "Example" ) ... my menu
12
2162
by: bullockbefriending bard | last post by:
I am a complete ignoramus and newbie when it comes to designing and coding networked clients (or servers for that matter). I have a copy of Goerzen (Foundations of Python Network Programming) and once pointed in the best direction should be able to follow my nose and get things sorted... but I am not quite sure which is the best path to take...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
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...
0
7715
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. ...
0
7808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
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...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
757
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...

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.