All pastes #48032 Raw Edit

Miscellany

public python v1 · immutable
#48032 ·published 2006-04-03 22:37 UTC
rendered paste body
import wxclass MainFrame( wx.Frame ):    def __init__(self):        wx.Frame.__init__(self,None,-1,"Verifica Chaves")        painel = wx.Panel(self)        mainSizer = wx.BoxSizer( wx.VERTICAL )                toplbl = wx.StaticText(painel,-1,"Insira a Sua Chave:")        num1 = wx.TextCtrl(painel,-1,"",size=(30,25))        num2 = wx.TextCtrl(painel,-1,"",size=(30,25))        num3 = wx.TextCtrl(painel,-1,"",size=(30,25))        num4 = wx.TextCtrl(painel,-1,"",size=(30,25))        num5 = wx.TextCtrl(painel,-1,"",size=(30,25))        plus = wx.StaticText(painel,-1,"+",size=(30,25))        str1 = wx.TextCtrl(painel,-1,"",size=(30,25))        str2 = wx.TextCtrl(painel,-1,"",size=(30,25))        _2line = wx.FlexGridSizer( cols=10, hgap=5, vgap=5)        _2line.Add(num1)        _2line.Add(num2)        _2line.Add(num3)        _2line.Add(num4)        _2line.Add(num5)        _2line.Add(plus)        _2line.Add(str1)        _2line.Add(str2)        _2line.Add((10,10))        openfilelbl = wx.StaticText(painel,-1,"Ficheiro: ",size=(50,25))## Change This field        openfiledata = wx.TextCtrl(painel,-1,"",size=(100,25))#########        openfilebutton = wx.Button ( painel, 100, 'Open' )        wx.EVT_BUTTON ( painel, 100, self.Open )        _3line = wx.FlexGridSizer( cols=3,vgap=5 ,hgap=5)        _3line.Add( openfilelbl )        _3line.Add( openfiledata )        _3line.Add( openfilebutton )        mainSizer.Add( toplbl )        mainSizer.Add( _2line )        mainSizer.Add( _3line )#        openfiledata.SetValue( "lol" )                painel.SetSizer( mainSizer )        mainSizer.Fit(self)        self.SetSizeHints(*self.GetSize())    def Open(self,event):        openfile = wx.FileDialog(None,"Escolha o Ficheiro:")        if openfile.ShowModal()== wx.ID_OK:            directory = openfile.GetDirectory()            filename  = openfile.GetFilename()#### FROM HERE            self.openfiledata.SetValue("lol" )        return 0app = wx.PySimpleApp()frame = MainFrame()frame.Show()app.MainLoop()