Skip to content

Commit

Permalink
bumping version
Browse files Browse the repository at this point in the history
  • Loading branch information
tuttza committed Aug 22, 2021
1 parent 2ed0d16 commit 00a5b0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ app_options = {
can_resize: true
}.freeze


MittensUi::Application.Window(app_options) do
add_contact_button = MittensUi::Button.new(title: "Add")
remove_contact_button = MittensUi::Button.new(title: "Remove")
file_menus = { "File": { sub_menus: ["Exit"] } }.freeze

fm = MittensUi::FileMenu.new(file_menus).render

add_contact_button = MittensUi::Button.new(title: "Add", icon: :add_green)
remove_contact_button = MittensUi::Button.new(title: "Remove", icon: :remove_red)

buttons = [ add_contact_button, remove_contact_button ]

Expand Down Expand Up @@ -68,7 +73,6 @@ MittensUi::Application.Window(app_options) do
MittensUi::HBox.new(tb_list, spacing: 10).render

# ACTONS

add_contact_button.click do |_b|
if tb_list.map { |tb| tb.text.length > 0 }.all?
contacts_table.add(tb_list.map {|tb| tb.text })
Expand All @@ -80,7 +84,7 @@ MittensUi::Application.Window(app_options) do
removed = contacts_table.remove_selected

if removed.size > 0
MittensUi::Alert.new("#{removed[0]} was removed.").render
MittensUi::Notify.new("#{removed[0]} was removed.", type: :info).render
end
end

Expand All @@ -95,8 +99,12 @@ MittensUi::Application.Window(app_options) do

MittensUi::Alert.new(msg).render
end
end

fm.exit do |fm|
MittensUi::Application.exit { print "Exiting App!"}
end

end
```

## Development
Expand Down
4 changes: 1 addition & 3 deletions examples/contacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@


MittensUi::Application.Window(app_options) do
file_menus = {
"File": { sub_menus: ["Exit"] }
}.freeze
file_menus = { "File": { sub_menus: ["Exit"] } }.freeze

fm = MittensUi::FileMenu.new(file_menus).render

Expand Down
2 changes: 1 addition & 1 deletion lib/mittens_ui/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MittensUi
VERSION = "0.0.10"
VERSION = "0.0.11"
end

0 comments on commit 00a5b0e

Please sign in to comment.