require 'wx' # load in the generated code require 'my_frame' # Mix-in for a Wx::TextCtrl module CaseChangeTextCtrl # convert all the text in the control to upper case def upcase! self.value = self.value.upcase end # convert all the text in the control to lower case def downcase! self.value = self.value.downcase end end # Inherit from the generated base class and set up event handlers class CaseChangeFrame < TextFrameBase def initialize super evt_button(:upper_bt) { text_box.upcase! } evt_button(:lower_bt) { text_box.downcase! } end end # Run the class Wx::App.run do CaseChangeFrame.new.show end