Module: GamesParadise::GUI::Gtk::Mastermind::IconAndLabelModule
- Includes:
- Gtk::BaseModule
- Included in:
- IconAndLabel
- Defined in:
- lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
- TITLE =
#
TITLE
#
'Icon and Label'
- WIDTH =
#
WIDTH
#
1200
- HEIGHT =
#
HEIGHT
#
1000
Class Method Summary collapse
-
.run ⇒ Object
# === GamesParadise::GUI::Gtk::IconAndLabelModule.run ========================================================================= #.
Instance Method Summary collapse
-
#change_markup_to(how = :normal) ⇒ Object
# === change_markup_to ========================================================================= #.
-
#connect_skeleton ⇒ Object
# === connect_skeleton ========================================================================= #.
-
#hide_img ⇒ Object
# === hide_img ========================================================================= #.
-
#initialize(text_on_button = 'Hello world!', reveal_or_dont_reveal = false, run_already = true) ⇒ Object
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#reveal_img ⇒ Object
# === reveal_img ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
-
#url_for(i) ⇒ Object
# === url_for.
Class Method Details
.run ⇒ Object
#
GamesParadise::GUI::Gtk::IconAndLabelModule.run
#
140 141 142 143 144 145 146 147 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 140 def self.run require 'gtk_paradise/run' _ = ::GamesParadise::GUI::Gtk::Mastermind::IconAndLabel.new r = ::Gtk.run r << _ r.set_size_request(_.width?, _.height?) r.top_left_then_run end |
Instance Method Details
#change_markup_to(how = :normal) ⇒ Object
#
change_markup_to
#
98 99 100 101 102 103 104 105 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 98 def change_markup_to(how = :normal) case how when :bold @label.set_markup("<b>#{@text_on_button}</b>") else @label.set_markup(@text_on_button) end end |
#connect_skeleton ⇒ Object
#
connect_skeleton
#
124 125 126 127 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 124 def connect_skeleton minimal(@image, 1) maximal(@label, 1) end |
#hide_img ⇒ Object
#
hide_img
#
117 118 119 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 117 def hide_img @image.hide end |
#initialize(text_on_button = 'Hello world!', reveal_or_dont_reveal = false, run_already = true) ⇒ Object
#
initialize
#
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 50 def initialize( = 'Hello world!', reveal_or_dont_reveal = false, run_already = true ) super(:horizontal) reset @text_on_button = .to_s @image = gtk_image(url_for(:pfeil1)) @label = gtk_label case reveal_or_dont_reveal when true reveal_img when false hide_img end change_markup_to # default, normal run if run_already end |
#reset ⇒ Object
#
reset
#
73 74 75 76 77 78 79 80 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 73 def reset reset_the_internal_variables # ======================================================================= # # === @configuration # ======================================================================= # @configuration = [true, __dir__, NAMESPACE] use_project_css_file end |
#reveal_img ⇒ Object
#
reveal_img
#
110 111 112 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 110 def reveal_img @image.show end |
#run ⇒ Object
#
run
#
132 133 134 135 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 132 def run connect_skeleton show end |
#url_for(i) ⇒ Object
#
url_for
Get beautiful URL here.
#
87 88 89 90 91 92 93 |
# File 'lib/games_paradise/mastermind/shared_code/icon_and_label_module.rb', line 87 def url_for(i) case i when :pfeil1 i = ENV['IMG']+'/STD/PFEIL1.png' end i end |