Class: GamesAndRpgParadise::GUI::Gtk::XmasGifts
- Inherits:
-
Gtk::VBox
- Object
- Gtk::VBox
- GamesAndRpgParadise::GUI::Gtk::XmasGifts
show all
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb
Overview
GamesAndRpgParadise::GUI::Gtk::XmasGifts
Constant Summary
collapse
- NAMESPACE =
inspect
- TITLE =
'Xmas Gifts'
- HEIGHT =
800
- WIDTH =
800
- ARRAY_BUTTONS =
[]
Instance Method Summary
collapse
Constructor Details
#initialize(run_already = true) ⇒ XmasGifts
52
53
54
55
56
57
58
|
# File 'lib/games_and_rpg_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
136
137
138
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 136
def connect_skeleton
add(@frame)
end
|
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_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 110
def create_buttons
@x_position = 1
@y_position = 1
counter_n_times = 0
25.times { |button|
counter_n_times += 1
button = GiftButton.new(button.to_s)
ARRAY_BUTTONS << button
@x_position += (Gtk::GiftButton::DEFAULT_WIDTH+3)
if ((counter_n_times % 5) == 0)
@x_position = 0 @y_position += (Gtk::GiftButton::DEFAULT_WIDTH+3)
end
@fixed.put(button, @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_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 95
def create_frame
@frame = gtk_frame
widget = gtk_label
widget.set_markup(
'<span weight="bold" size="xx-large" foreground="darkblue"> '+
TITLE+
' </span>'
)
@frame.label_widget = widget
@frame << @fixed
end
|
#create_skeleton ⇒ Object
83
84
85
86
87
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 83
def create_skeleton
@fixed = gtk_fixed
create_buttons
create_frame
end
|
#favicon? ⇒ Boolean
157
158
159
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 157
def favicon?
'/home/x/data/images/games/XMAS/XMAS_FAVICON.png'
end
|
#padding? ⇒ Boolean
143
144
145
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 143
def padding?
8
end
|
#reset ⇒ Object
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 63
def reset
reset_the_internal_variables
@configuration = [true, __dir__, NAMESPACE]
set_height(HEIGHT)
set_width(WIDTH)
increase_font_size
end
|
#run ⇒ Object
164
165
166
167
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 164
def run
create_skeleton
connect_skeleton
end
|
#title? ⇒ Boolean
150
151
152
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/xmas_gifts.rb', line 150
def title?
TITLE
end
|