Hi,
I found if a wx.TextCtrl is used in a subclass of wx.Dialog, the
event wx.EVT_TEXT_ENTER can not be caught, that is, key code of RETURN
can not be indentified.
class MyDialog(wx.Dialog):
def __init__(self,parent,pos,size,style):
...
self.t1 = wx.TextCtrl(self, -1, "", size=(125, -1))
self.t1.Bind(wx.EVT_CHAR, self.OnChar,self.t1)
...
def OnChar(self, event):
if (event.GetKeyCode() == 13):
print "%d"%event.GetKeyCode()
else:
print "%d"%event.GetKeyCode()
event.Skip()
How could I effectively bind a handler to EVT_TEXT_ENTER in it?
Thanks,
Sean 1 3447
On Tue, 2004-10-12 at 04:32 -0700, Sean wrote: Hi, I found if a wx.TextCtrl is used in a subclass of wx.Dialog, the event wx.EVT_TEXT_ENTER can not be caught, that is, key code of RETURN can not be indentified.
class MyDialog(wx.Dialog): def __init__(self,parent,pos,size,style): ... self.t1 = wx.TextCtrl(self, -1, "", size=(125, -1)) self.t1.Bind(wx.EVT_CHAR, self.OnChar,self.t1) ...
def OnChar(self, event): if (event.GetKeyCode() == 13): print "%d"%event.GetKeyCode() else: print "%d"%event.GetKeyCode() event.Skip()
How could I effectively bind a handler to EVT_TEXT_ENTER in it?
You need to specify the following style for the textctrl:
self.t1 = wx.TextCtrl(self, -1, "", style = wx.TE_PROCESS_ENTER)
Regards,
Cliff
--
Cliff Wells <cl************@comcast.net> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gerry Sutton |
last post by:
Hi All!
I have noticed a strange behavior when using a constant identifier to
initialize an instance list variable in a base class and then trying to
modifying the list in subclasses by using...
|
by: flupke |
last post by:
I'm using wxPython and design the gui via wxglade. One of the gui
components is a simple dialog class that gets displayed when a user
exits the program.
I want to use the same dialog but with a...
|
by: Z.K. |
last post by:
I was wondering if someone could tell me how or point me to an
appropriate web page that will show me how to subclass a control in
vc++.net 2002. What I want to do is to be able to pop up a dialog...
|
by: Patricia Kline |
last post by:
On a few of my projects, when i try to open them, i get the MS Developement Environment error dialog. When i click the: To see what data this error report contains, click here. It gives the...
|
by: Lou Pecora |
last post by:
I've been scanning Python in a Nutshell, but this seems to be either
undoable or so subtle that I don't know how to do it.
I want to subclass a base class that is returned from a Standard Library...
|
by: bartonc |
last post by:
#Boa:Dialog:DBConnectDialog
import wx
import wxdbtools as db
def create(parent):
return DBConnectDialog(parent)
=
|
by: bartonc |
last post by:
#Boa:Dialog:TiltCalibrate
import wx
import Multiply
from PMD import DefaultMultiplier
from time import sleep
from string import digits
from wxdbtools import MySQLInsert, MySQLUpdate,...
|
by: bartonc |
last post by:
#Boa:Dialog:DBConnectDialog
import wx
##"""Given a set if login specs, create a dbServer instance and
## ensure that there is a valid, open connection to the database.
## If not, set the...
|
by: bartonc |
last post by:
from MySQLdb import *
from time import time
class DBServer:
def __init__(self, master):
self.master = master
def Login(self, servername, username, password): #,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
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...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
| |