Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [wxPython] wxFrame don't have Bind attribute ??

Reply
Thread Tools

[wxPython] wxFrame don't have Bind attribute ??

 
 
Jia Lu
Guest
Posts: n/a
 
      10-30-2006
Hi all
I am using wxPy 2.6.3.2-2, But when run an application with self.Bind
, I got an error that there is no Bind.

How can I fix it. thanx

 
Reply With Quote
 
 
 
 
Steve Holden
Guest
Posts: n/a
 
      10-30-2006
Jia Lu wrote:
> Hi all
> I am using wxPy 2.6.3.2-2, But when run an application with self.Bind
> , I got an error that there is no Bind.
>
> How can I fix it. thanx
>

Perhaps you could show us the code that's failing, with the traceback -
even better, use the knowledge you have already gained to write a
*short* program that exhibits the same failure. Then post the code and
the traceback.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

 
Reply With Quote
 
 
 
 
SPE - Stani's Python Editor
Guest
Posts: n/a
 
      10-30-2006
Jia Lu schreef:

> Hi all
> I am using wxPy 2.6.3.2-2, But when run an application with self.Bind
> , I got an error that there is no Bind.
>
> How can I fix it. thanx


You can not bind an event to a wx application. You must bind an event
to a wx frame or control. You'll get more and better support on the
wxpython-user mailing list.

Stani

--
http://pythonide.stani.be

 
Reply With Quote
 
Jia Lu
Guest
Posts: n/a
 
      10-30-2006

Steve Holden のメッセージ:
> Perhaps you could show us the code that's failing,


the code is :

<code>
#!/usr/bin/python -tt

__author__ = "Jia Lu <(E-Mail Removed)>"
__verstion__ = "1.0.0"

import wx

class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "MyFrame", size=(300,300))
panel = wx.Panel(self, -1)
panel.Bind(wx.EVT_MOTION, self.OnMove)
wx.StaticText(panel, -1, "Pos:", pos=(100,105))
self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(130,100))

def OnMove(self, event):
pos = event.GetPosition()
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))

if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()

 
Reply With Quote
 
Frank Millman
Guest
Posts: n/a
 
      10-30-2006

Jia Lu wrote:
> Steve Holden のメッセージ:
> > Perhaps you could show us the code that's failing,

>
> the code is :
>
> <code>
> #!/usr/bin/python -tt
>
> __author__ = "Jia Lu <(E-Mail Removed)>"
> __verstion__ = "1.0.0"
>
> import wx
>
> class MyFrame(wx.Frame):
> def __init__(self):
> wx.Frame.__init__(self, None, -1, "MyFrame", size=(300,300))
> panel = wx.Panel(self, -1)
> panel.Bind(wx.EVT_MOTION, self.OnMove)
> wx.StaticText(panel, -1, "Pos:", pos=(100,105))
> self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(130,100))
>
> def OnMove(self, event):
> pos = event.GetPosition()
> self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
>
> if __name__ == "__main__":
> app = wx.PySimpleApp()
> frame = MyFrame()
> frame.Show(True)
> app.MainLoop()


This works perfectly for me, using wxPython 2.6.3.2, on both Linux and
Windows.

What platform are you using?

Frank Millman

 
Reply With Quote
 
Jia Lu
Guest
Posts: n/a
 
      10-30-2006

Frank Millman のメッセージ:
> This works perfectly for me, using wxPython 2.6.3.2, on both Linux and
> Windows.
>
> What platform are you using?

Yes this works OK for me too on my FedoraCore 5, but cannot work on my
FedoraCore 6...

 
Reply With Quote
 
Frank Millman
Guest
Posts: n/a
 
      10-30-2006

Jia Lu wrote:
> Frank Millman のメッセージ:
> > This works perfectly for me, using wxPython 2.6.3.2, on both Linux and
> > Windows.
> >
> > What platform are you using?

> Yes this works OK for me too on my FedoraCore 5, but cannot work on my
> FedoraCore 6...


Then it is probably an installation problem, which I doubt if I can
help with. However, if you can answer the following questions, someone
else may be able to assist -

1. What is the exact error message?

2. Which version of wxPython are you using?

3. How did you install wxPython - by compiling from source, or by
installing an rpm? I don't think there are any FC6 rpm's available yet.

If you don't get an answer here, ask on the wxPython mailing list -
http://www.velocityreviews.com/forums/(E-Mail Removed)

Frank

 
Reply With Quote
 
Franz Steinhaeusler
Guest
Posts: n/a
 
      11-17-2006
On 29 Oct 2006 22:31:09 -0800, "Jia Lu" <(E-Mail Removed)> wrote:

>Hi all
> I am using wxPy 2.6.3.2-2, But when run an application with self.Bind
>, I got an error that there is no Bind.
>
> How can I fix it. thanx


Is it really an instance of wx.Frame?
What do you get, if you make a "print self" statement?
 
Reply With Quote
 
Jia Lu
Guest
Posts: n/a
 
      11-17-2006

Franz Steinhaeusler wrote:
> Is it really an instance of wx.Frame?
> What do you get, if you make a "print self" statement?

sovled it
I think it is an installation problem.
I used yum on FC6 to install wxPython 2.6
But after that I got that error.

Now I uninstalled them and did an installation of wxPy 2.7 manully.
It is ok now..

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[wxPython] Many wxPanel forms in 1 wxFrame CYBER Python 2 05-02-2005 11:59 PM
wxPython: accessing wxFrame methods in __del__ fails Alex VanderWoude Python 2 03-25-2005 05:59 AM
How to set the size of wxFrame Austin Python 1 10-28-2004 03:26 PM
wxPython: Fit() works on wxPanel, but not on surrounding wxFrame Piet Python 1 05-20-2004 05:34 PM
Re: wxPython: need return value from wxFrame Mirko Koenig Python 4 08-27-2003 04:46 PM



Advertisments