Use code tag next time you post.
import wx
class duff(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,wx.ID_ANY,'Duffan Formula', size=(400,300)) #wx.ID_ANY
self.panel = wx.Panel(self) #self.panel
#self.panel on all
g=wx.StaticText(self.panel,-1,"________________________________________________________",pos=(10,65))
z=wx.StaticText(self.panel,-1,"Welcome to Duffan Formula!!",pos=(10,10))
r=wx.StaticText(self.panel,-1,"Here you can discover the score of any girl you are looking for.",pos=(10,30))
q=wx.StaticText(self.panel,-1,"Use it, with Knowledge!",pos=(10,50))
a=wx.StaticText(self.panel,-1,"What`s her name?",pos=(10,110))
b=wx.StaticText(self.panel,-1,"What`s her beauty score?",pos=(10,150))
c=wx.StaticText(self.panel,-1,"What`s her body score?",pos=(10,190))
average=wx.StaticText(self.panel,-1,"Average: ", pos=(80,222.5)).SetForegroundColour('blue')
self.one=wx.TextCtrl(self.panel,-1,'Enter name',pos=(110,108),size=(80,20))
self.two=wx.SpinCtrl(self.panel,-1,'1',pos=(150,148),size=(60,20),min=0,max=100)
self.three=wx.SpinCtrl(self.panel,-1,'1',pos=(130,188),size=(60,20),min=0,max=100)
wx.StaticBox(self.panel,-1,'Personal Info', (5,90),size=(250,160))
ae=wx.Button(self.panel,label="Done",pos=(10,220),size=(60,20))
self.Bind(wx.EVT_BUTTON,self.clickbutton,ae)
self.Centre()
self.Show(True)
def clickbutton(self,event):
'''
Now this method can use self.panel
Without self method can not use panel
'''
s1=self.two.GetValue()
s2=self.three.GetValue()
media = s1
if 0<=media<=100:
wx.StaticText(self.panel,-1, str(media) ,pos=(135,222)) #str(media)
if __name__=='__main__':
app=wx.PySimpleApp()
frame=duff(parent=None,id=-1)
frame.Show()
app.MainLoop() snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294