#!/usr/bin/env python import wx import empty import wx_ut import dbg def btn_go_hdl(inf): tc = inf.wxo.L.tc tc.SetValue( inf.label ) def run(): def init(wxo): tc = wxo.wx_new( wx.TextCtrl, '', min_h=80 ) btn_ok = wxo.wx_new( wx.Button, 'OK' ) btn_cancel = wxo.wx_new( wx.Button, 'Cancel' ) btn_go = wxo.wx_new( wx.Button, 'Go' ) def btn_hdl(inf): tc.SetValue( inf.label ) wxo.bind( [ btn_ok, btn_cancel ], btn_hdl ) wxo.bind( btn_go, btn_go_hdl ) wp = wxo.wp lsts = [ wp( [ wp( tc, prop=1,flag=wx.EXPAND ) ], prop=1, flag=wx.EXPAND ), wp( [ wp( btn_ok ), wp( btn_cancel ), wp( btn_go, prop=1 ) ], flag=wx.EXPAND ) ] wxo.wrap( wxo.frame, lsts ) wxo.L = empty.new( locals() ) wxo = wx_ut.new( 'wx sample 1', init ) wxo.main_loop() if __name__ == "__main__": run() # EOF