Basic skeleton app & lib, throws a window up

This commit is contained in:
2014-05-05 22:03:24 -07:00
parent c5fd4f6fb1
commit 46e99f766d
9 changed files with 113 additions and 32 deletions

6
lib/tailor.rb Normal file
View File

@@ -0,0 +1,6 @@
require "tailor/version"
require "tailor/GUI"
module Tailor
# Your code goes here...
end

29
lib/tailor/GUI.rb Normal file
View File

@@ -0,0 +1,29 @@
require 'wx'
module Tailor
module GUI
class Application < Wx::App
def on_init
MainWindow.new
end
end
class MainWindow < Wx::Frame
def initialize()
super(nil, -1, 'Tailor')
@mainpanel = Wx::Panel.new(self)
@close_button = Wx::Button.new(@mainpanel, -1, 'Quit')
evt_button(@close_button.get_id()) { |event| close_button_clicked(event) }
@mainpanel_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
@mainpanel.set_sizer(@mainpanel_sizer)
@mainpanel_sizer.add(@close_button, 0, Wx::GROW|Wx::ALL, 2)
show()
end
def close_button_clicked(event)
puts "I don't do anything, but good on you for using a mouse"
end
end
end
end

3
lib/tailor/version.rb Normal file
View File

@@ -0,0 +1,3 @@
module Tailor
VERSION = "0.0.1"
end