Class: GamesParadise::GUI::Gtk::XmasGifts
- Inherits:
-
Gtk::VBox
- Object
- Gtk::VBox
- GamesParadise::GUI::Gtk::XmasGifts
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb
Overview
GamesParadise::GUI::Gtk::XmasGifts
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
- TITLE =
#
TITLE
#
'Xmas Gifts'
- HEIGHT =
#
HEIGHT
#
800
- WIDTH =
#
WIDTH
#
800
- ARRAY_BUTTONS =
#
ARRAY_BUTTONS
#
[]
Instance Method Summary collapse
-
#connect_skeleton ⇒ Object
# === connect_skeleton ========================================================================= #.
-
#create_buttons ⇒ Object
# === create_buttons ========================================================================= #.
-
#create_frame ⇒ Object
# === create_frame.
-
#create_skeleton ⇒ Object
# === create_skeleton ========================================================================= #.
-
#favicon? ⇒ Boolean
# === favicon? ========================================================================= #.
-
#initialize(run_already = true) ⇒ XmasGifts
constructor
# === initialize ========================================================================= #.
-
#padding? ⇒ Boolean
# === padding? ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
-
#title? ⇒ Boolean
# === title? ========================================================================= #.
Constructor Details
#initialize(run_already = true) ⇒ XmasGifts
#
initialize
#
52 53 54 55 56 57 58 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 52 def initialize( run_already = true ) super() reset run if run_already end |
Instance Method Details
#connect_skeleton ⇒ Object
#
connect_skeleton
#
136 137 138 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 136 def connect_skeleton add(@frame) end |
#create_buttons ⇒ Object
#
create_buttons
#
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 110 def @x_position = 1 @y_position = 1 # ======================================================================= # # 25 times because, well: 25 days before xmas. :) # ======================================================================= # counter_n_times = 0 25.times { || counter_n_times += 1 = GiftButton.new(.to_s) ARRAY_BUTTONS << @x_position += (Gtk::GiftButton::DEFAULT_WIDTH+3) if ((counter_n_times % 5) == 0) @x_position = 0 # Reset the x-position again. @y_position += (Gtk::GiftButton::DEFAULT_WIDTH+3) end # ===================================================================== # # Next place it somewhere on the grid. # ===================================================================== # @fixed.put(, @x_position, @y_position) } end |
#create_frame ⇒ Object
#
create_frame
The gtk-frame in use here is the main “background” widget for this application.
#
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 95 def create_frame @frame = gtk_frame = gtk_label .set_markup( '<span weight="bold" size="xx-large" foreground="darkblue"> '+ TITLE+ ' </span>' ) @frame. = @frame << @fixed end |
#create_skeleton ⇒ Object
#
create_skeleton
#
83 84 85 86 87 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 83 def create_skeleton @fixed = gtk_fixed create_frame end |
#favicon? ⇒ Boolean
#
favicon?
#
157 158 159 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 157 def favicon? '/home/x/data/images/games/XMAS/XMAS_FAVICON.png' end |
#padding? ⇒ Boolean
#
padding?
#
143 144 145 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 143 def padding? 8 end |
#reset ⇒ Object
#
reset
#
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 63 def reset reset_the_internal_variables # ======================================================================= # # === @configuration # ======================================================================= # @configuration = [true, __dir__, NAMESPACE] # ======================================================================= # # === @height # ======================================================================= # set_height(HEIGHT) # ======================================================================= # # === @width # ======================================================================= # set_width(WIDTH) increase_font_size end |
#run ⇒ Object
#
run
#
164 165 166 167 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 164 def run create_skeleton connect_skeleton end |
#title? ⇒ Boolean
#
title?
#
150 151 152 |
# File 'lib/games_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 150 def title? TITLE end |