|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Dialog application ...
I tried to make dialog based application using wxPython but it doesnt work, I managed to get the Dialog Box but I can put text box, button etc... here's the code... anythingh wrong?
Code:
from wxPython.wx import *
class testdialog(wxDialog):
def _init_(self,parent,ID,title,pos,size):
wxDialog._init__(self,parent,ID,title,pos,size)
self.tHello = wxTextCtrl(panel, -1, '', (3,3), (185,22))
self.bHello = wxTextCtrl(panel, -1, '', (3,30), (185,22))
self.tHello.SetInsertionPoint(1)
button = wxButton(panel, 10, 'Count', (3, 60))
button_clear = wxButton(panel,11,'Clear',(112,60))
class okrun(wxApp):
def OnInit(self):
dlg = testdialog(NULL,-1,'My Dialog',(200,200),(300,120))
dlg.ShowModal()
dlg.Destroy()
return true
app = okrun()
app.MainLoop()
|
|
#2
|
||||
|
||||
|
I havn't done much with wxPython so there could be other problems besides this on but as i see it _init_ and _init__ should both be __init__. Try changing that and give it a go
.Mark. |
|
#3
|
||||
|
||||
|
In addition your references to panel should be self:
Code:
from wxPython.wx import *
class testdialog(wxDialog):
def __init__(self,parent,ID,title,pos,size):
from wxPython.lib.layoutf import Layoutf
id = wxNewId()
wxDialog.__init__(self,parent,id,title,pos,size)
panel = self
self.tHello = wxTextCtrl(panel, id,'', (3,3), (185,22))
self.bHello = wxTextCtrl(panel, id, '', (3,30), (185,22))
self.tHello.SetInsertionPoint(1)
button = wxButton(panel, id, 'Count', (3, 60))
button_clear = wxButton(panel,id,'Clear',(112,60))
class okrun(wxApp):
def OnInit(self):
return True
app = okrun(0)
dlg = testdialog(NULL,-1,'My Dialog',(200,200),(300,120))
dlg.ShowModal()
dlg.Destroy()
Now you need to add the event logic ![]() Grim
__________________
*** Experimental Python Markup CGI V2 *** |
|
#4
|
|||
|
|||
|
Thanx Grim it works
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Dialog application ... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|