Module: Shoes::Builtins
- Included in:
- Kernel
- Defined in:
- lacci/lib/shoes/builtins.rb
Overview
Shoes has a number of built-in methods that are intended to be available everywhere, in every Shoes and non-Shoes class, for every Shoes app.
Instance Method Summary collapse
- #alert(message) ⇒ Object
- #ask(message_string) ⇒ Object
- #ask_color(title_bar) ⇒ Object
- #ask_open_file ⇒ Object
- #ask_open_folder ⇒ Object
- #ask_save_file ⇒ Object
- #ask_save_folder ⇒ Object
- #confirm(question) ⇒ Object
-
#font(font_file_or_url) ⇒ void
Register the given font with Shoes so that text that wants it can use it.
Instance Method Details
#alert(message) ⇒ Object
22 23 24 |
# File 'lacci/lib/shoes/builtins.rb', line 22 def alert() shoes_builtin("alert", ) end |
#ask(message_string) ⇒ Object
18 19 20 |
# File 'lacci/lib/shoes/builtins.rb', line 18 def ask() shoes_builtin("ask", ) end |
#ask_color(title_bar) ⇒ Object
26 27 28 |
# File 'lacci/lib/shoes/builtins.rb', line 26 def ask_color() shoes_builtin("ask_color", ) end |
#ask_open_file ⇒ Object
30 31 32 |
# File 'lacci/lib/shoes/builtins.rb', line 30 def ask_open_file() shoes_builtin("ask_open_file") end |
#ask_open_folder ⇒ Object
38 39 40 |
# File 'lacci/lib/shoes/builtins.rb', line 38 def ask_open_folder() shoes_builtin("ask_open_folder") end |
#ask_save_file ⇒ Object
34 35 36 |
# File 'lacci/lib/shoes/builtins.rb', line 34 def ask_save_file() shoes_builtin("ask_save_file") end |
#ask_save_folder ⇒ Object
42 43 44 |
# File 'lacci/lib/shoes/builtins.rb', line 42 def ask_save_folder() shoes_builtin("ask_save_folder") end |
#confirm(question) ⇒ Object
46 47 48 |
# File 'lacci/lib/shoes/builtins.rb', line 46 def confirm(question) shoes_builtin("confirm", question) end |
#font(font_file_or_url) ⇒ void
This method returns an undefined value.
Register the given font with Shoes so that text that wants it can use it. Also add it to the FONTS constant.
11 12 13 14 15 16 |
# File 'lacci/lib/shoes/builtins.rb', line 11 def font(font_file_or_url) shoes_builtin("font", font_file_or_url) font_name = File.basename(font_file_or_url, ".*") Shoes::FONTS << font_name end |