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

Instance Method Details

#alert(message) ⇒ Object



22
23
24
# File 'lacci/lib/shoes/builtins.rb', line 22

def alert(message)
  shoes_builtin("alert", message)
end

#ask(message_string) ⇒ Object



18
19
20
# File 'lacci/lib/shoes/builtins.rb', line 18

def ask(message_string)
  shoes_builtin("ask", message_string)
end

#ask_color(title_bar) ⇒ Object



26
27
28
# File 'lacci/lib/shoes/builtins.rb', line 26

def ask_color(title_bar)
  shoes_builtin("ask_color", title_bar)
end

#ask_open_fileObject



30
31
32
# File 'lacci/lib/shoes/builtins.rb', line 30

def ask_open_file()
  shoes_builtin("ask_open_file")
end

#ask_open_folderObject



38
39
40
# File 'lacci/lib/shoes/builtins.rb', line 38

def ask_open_folder()
  shoes_builtin("ask_open_folder")
end

#ask_save_fileObject



34
35
36
# File 'lacci/lib/shoes/builtins.rb', line 34

def ask_save_file()
  shoes_builtin("ask_save_file")
end

#ask_save_folderObject



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.

Parameters:

  • font_file_or_url (String)

    the filename or URL for the font



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