Basic skeleton app & lib, throws a window up
This commit is contained in:
6
lib/tailor.rb
Normal file
6
lib/tailor.rb
Normal 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
29
lib/tailor/GUI.rb
Normal 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
3
lib/tailor/version.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
module Tailor
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
Reference in New Issue
Block a user