Created
January 22, 2010 14:42
-
-
Save anonymous/283794 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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