Skip to content

Instantly share code, notes, and snippets.

Created January 22, 2010 21: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/284158 to your computer and use it in GitHub Desktop.
Save anonymous/284158 to your computer and use it in GitHub Desktop.
module LogoPanel
def setup_resources
img_file = File.join(File.dirname(__FILE__),"..","images","kirin","logo.png")
@logo_bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY)
self.evt_paint do |event|
self.paint do |dc|
dc.draw_bitmap(@logo_bitmap,0,0,false)
end
end
end
end
class GuiMain < XrcFrameMain
# Keys are: mb = menubar, tb = toolbar, fm = file menu
def initialize
super()
# paint our Gui
paint_gui_frames
# find events
register_event_handlers
end
end
def paint_gui_frames
# paint our main gui
img_file = File.join(File.dirname(__FILE__),"..","images","kirin","bg.png")
@main_gui_bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY)
self.evt_erase_background do |event|
self.paint do |dc|
dc.draw_bitmap(@main_gui_bitmap,0,0,false)
end
end
# paint our logo
@logo.setup_resources()
end
def register_event_handlers
# evt_button(Wx::ID_ANY) { 'some button was pressed' }
# 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 )
# Process Status Bar Events text (3 frames so 0,1,2 are relevant array positions)
st_response("Idle...",2)
st_response(Time.now.strftime("%B %d, %Y"), 1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment