Hi.
“instancemethod object is not an iterator” - this is one of errors I receive while trying to bind Enter key to my TextCtrl field.
Could someone help me to bind Enter key to my TextCtrl field to display different random number each time, please?
Code here: http://codepad.org/93GpS5TX
self.Bind(wx.EVT_TEXT,self.OnKeyPressed,self.NameOffTextControl)
#then make a def
def OnKeyPressed(self, event):
and menage the making you want.
see also th help wxKeyEvent
···
Il 01/09/2012 20:00, dryhay ha scritto:
Hi.
"instancemethod object is not an iterator" - this is one of errors I receive while trying to bind Enter key to my TextCtrl field.
Could someone help me to bind Enter key to my TextCtrl field to display different random number each time, please?
Code here: http://codepad.org/93GpS5TX
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
I don't see the error here. What platform and version are you using? What is the full traceback? Can you make a complete runnable sample that shows just the problem and not all the other stuff?
http://wiki.wxpython.org/MakingSampleApps
···
On 9/1/12 11:00 AM, dryhay wrote:
Hi.
"instancemethod object is not an iterator" - this is one of errors I
receive while trying to bind Enter key to my TextCtrl field.
Could someone help me to bind Enter key to my TextCtrl field to display
different random number each time, please?
Code here: http://codepad.org/93GpS5TX
--
Robin Dunn
Software Craftsman
I don’t see the error here. What platform and version are you using?
What is the full traceback? Can you make a complete runnable sample
that shows just the problem and not all the other stuff?
> http://wiki.wxpython.org/MakingSampleApps
Problems always appear while I’m testing my code without hash # covers (which I left in my code).
My current code during tests:
- with hashes (without errors and working without Enter key events, which I want to get) the runnable sample is here: http://codepad.org/Cx0LbfaX
- without hashes current sample (returning errors) is here: http://codepad.org/AjLdxbdv
current error:
“The debugged program raised the exception unhandled AttributeError
“‘bool’ object has no attribute ‘GetId’”
File: /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py, Line: 3917”
Aim: I want to implement Enter key events to my testing code. I want to change appearing numbers (which should be non repeatable from already implemented rnd_gen generator) without closing the pop up but with the keyboard Enter key event instead.
Kind regards
dry hay
The problem is exactly what the error is telling you. The 3rd parameter to Bind is expected to have a method called GetId, (which should return the ID of the widget that will be generating the bound event.) Instead, you are passing it the return value of ProcessEvent, which is a boolean value. If you take a moment to listen to her and think a little bit, Python will usually tell you exactly what you are doing wrong.
···
On 9/1/12 9:34 PM, dryhay wrote:
> I don't see the error here. What platform and version are you using?
> What is the full traceback? Can you make a complete runnable sample
> that shows just the problem and not all the other stuff?
> MakingSampleApps - wxPyWiki
<http://wiki.wxpython.org/MakingSampleApps>Problems always appear while I'm testing my code without hash # covers
(which I left in my code).
My current code during tests:
- with hashes (without errors and working without Enter key events,
which I want to get) the runnable sample is here:
http://codepad.org/Cx0LbfaX
- without hashes current sample (returning errors) is here:
http://codepad.org/AjLdxbdv
current error:
"The debugged program raised the exception unhandled AttributeError
"'bool' object has no attribute 'GetId'"
File: /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py,
Line: 3917"
--
Robin Dunn
Software Craftsman
The problem is exactly what the error is telling you. The 3rd parameter
to Bind is expected to have a method called GetId, (which should return
the ID of the widget that will be generating the bound event.) Instead,
you are passing it the return value of ProcessEvent, which is a boolean
value. If you take a moment to listen to her and think a little bit,
Python will usually tell you exactly what you are doing wrong.
Unfortunately I still receive lots of errors, even while consulting the problem with others. My current code while trying to use Enter key event is here: http://codepad.org/8S0lZuQI
Could someone help me, plz?
dryhay
OK
all problems fixed