Skip to content

Instantly share code, notes, and snippets.

Created January 22, 2010 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/283794 to your computer and use it in GitHub Desktop.
Save anonymous/283794 to your computer and use it in GitHub Desktop.
class GuiMain < XrcFrameMain
def initialize
super()
# File Menu - new workspace
evt_menu( @mb_fm_new, :on_new_workspace )
# File Menu - save workspace
evt_menu( @mb_fm_save, :on_save_workspace )
# File Menu - exit
evt_menu( @mb_fm_exit, :on_exit )
# Status Bar text (3 frames so 0,1,2 are relevant array positions)
# custom call to a shorter set_status event.
st_response("Idle...",2)
st_response(Time.now.strftime("%B %d, %Y"), 1)
end
end
def on_new_workspace
...
end
def on_save_workspace
...
end
def on_exit
Close
end
etc.
etc.
require 'wx'
require 'pp'
load 'lib/globals.rb'
load 'lib/wxhelper.rb'
WxHelper.include_ui
WxHelper.setup_init
load 'lib/main.rb'
# Begin the App
class WXTemplate < Wx::App
def on_init
gui_main = GuiMain.new
# Adding a Timer to Pass Threads
t = Wx::Timer.new(self, 55)
evt_timer(55) { Thread.pass }
t.start(20)
gui_main.show
end
end
WXTemplate.new.main_loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment