events in wxpython user interfaces now configure the enter button enter_button wx button(panellabel='enter'enter_button bind(wx evt_buttonself set_namenext set up the text label self label wx statictext(panellabel='welcome'style=wx align_leftnow configure the show message button message_button wx button(panellabel='show message'message_button bind(wx evt_buttonself show_messageadd the widgets to the grid sizer to handle layout grid addmany([self textenter_buttonself labelmessage_button]set the sizer on the panel panel setsizer(gridcentre the frame on the computer screen self centre(def show_message(selfevent)""event handler to display the message dialog using the current value of the name attribute ""dialog wx messagedialog(nonemessage='welcome to python self namecaption='hello'style=wx okdialog showmodal(def set_name(selfevent)""event handler for the enter button retrieves the text entered into the input field and sets the self name attribute this is then used to set the text label ""self name self text getlinetext( self label setlabeltext('welcome self name