andrea valle
2004-10-12 23:31:00 UTC
Here total newbie to wxpython.
As I was translating an example I did in Tkinter I was asking myself
how to do it in wx.
So I was in need of a simple rectangle and tested with this code from
lesson 1 of wiki.
It doesn't work.
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
rect = wxRect(0, 0, 250, 250)
dc = wxDC()
dc.DrawRectangle(rect)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Two prayers:
a) what have I to do to draw a rectangle? (Then I will have to set
dynamically its coordinates).
b) how can I read the references? Dunno exactly what the whole stuff
means, as I wasn't able to find any example of code in it (I'm not used
with all those :: )
Thanks a lot and sorry for the silly question
Best
-a-
As I was translating an example I did in Tkinter I was asking myself
how to do it in wx.
So I was in need of a simple rectangle and tested with this code from
lesson 1 of wiki.
It doesn't work.
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
rect = wxRect(0, 0, 250, 250)
dc = wxDC()
dc.DrawRectangle(rect)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Two prayers:
a) what have I to do to draw a rectangle? (Then I will have to set
dynamically its coordinates).
b) how can I read the references? Dunno exactly what the whole stuff
means, as I wasn't able to find any example of code in it (I'm not used
with all those :: )
Thanks a lot and sorry for the silly question
Best
-a-