Basic skeleton app & lib, throws a window up
This commit is contained in:
52
.gitignore
vendored
52
.gitignore
vendored
@@ -1,34 +1,22 @@
|
|||||||
*.gem
|
*.gem
|
||||||
*.rbc
|
*.rbc
|
||||||
/.config
|
.bundle
|
||||||
/coverage/
|
.config
|
||||||
/InstalledFiles
|
.yardoc
|
||||||
/pkg/
|
Gemfile.lock
|
||||||
/spec/reports/
|
InstalledFiles
|
||||||
/test/tmp/
|
_yardoc
|
||||||
/test/version_tmp/
|
coverage
|
||||||
/tmp/
|
doc/
|
||||||
|
lib/bundler/man
|
||||||
## Specific to RubyMotion:
|
pkg
|
||||||
.dat*
|
rdoc
|
||||||
.repl_history
|
spec/reports
|
||||||
build/
|
test/tmp
|
||||||
|
test/version_tmp
|
||||||
## Documentation cache and generated files:
|
tmp
|
||||||
/.yardoc/
|
*.bundle
|
||||||
/_yardoc/
|
*.so
|
||||||
/doc/
|
*.o
|
||||||
/rdoc/
|
*.a
|
||||||
|
mkmf.log
|
||||||
## Environment normalisation:
|
|
||||||
/.bundle/
|
|
||||||
/lib/bundler/man/
|
|
||||||
|
|
||||||
# for a library or gem, you might want to ignore these files since the code is
|
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
|
||||||
# Gemfile.lock
|
|
||||||
# .ruby-version
|
|
||||||
# .ruby-gemset
|
|
||||||
|
|
||||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
||||||
.rvmrc
|
|
||||||
|
|||||||
4
Gemfile
Normal file
4
Gemfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
# Specify your gem's dependencies in tailor.gemspec
|
||||||
|
gemspec
|
||||||
22
LICENSE.txt
Normal file
22
LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright (c) 2014 Andrew Kesterson
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
3
bin/tailor
Normal file
3
bin/tailor
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
require 'tailor'
|
||||||
|
|
||||||
|
Tailor::GUI::Application.new.main_loop()
|
||||||
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
|
||||||
24
tailor.gemspec
Normal file
24
tailor.gemspec
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
lib = File.expand_path('../lib', __FILE__)
|
||||||
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||||
|
require 'tailor/version'
|
||||||
|
|
||||||
|
Gem::Specification.new do |spec|
|
||||||
|
spec.name = "tailor"
|
||||||
|
spec.version = Tailor::VERSION
|
||||||
|
spec.authors = ["Andrew Kesterson"]
|
||||||
|
spec.email = ["andrew@aklabs.net"]
|
||||||
|
spec.summary = "A GUI toolkit and library for working with image tilesets"
|
||||||
|
spec.description = ""
|
||||||
|
spec.homepage = "https://github.com/akesterson/tailor/"
|
||||||
|
spec.license = "MIT"
|
||||||
|
|
||||||
|
spec.files = `git ls-files -z`.split("\x0")
|
||||||
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||||
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||||
|
spec.require_paths = ["lib"]
|
||||||
|
|
||||||
|
spec.add_development_dependency "bundler", "~> 1.6"
|
||||||
|
spec.add_development_dependency "rake"
|
||||||
|
spec.add_dependency "wxruby-ruby19"
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user