Class: GamesAndRpgParadise::GUI::Gtk::ButtonContainingInformationAboutASingleCard
- Inherits:
-
Gtk::Box
- Object
- Gtk::Box
- GamesAndRpgParadise::GUI::Gtk::ButtonContainingInformationAboutASingleCard
show all
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb
Overview
Constant Summary
collapse
- NAMESPACE =
inspect
- TITLE =
'Pick a proper title here please.'
- WIDTH =
'5% or minimum 40px'
- HEIGHT =
'5% or minimum 30px'
- USE_THIS_FONT =
:dejavu_condensed_15
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 51
def initialize(
commandline_arguments = ARGV,
run_already = true
)
super(:vertical)
reset
set_commandline_arguments(
commandline_arguments
)
run if run_already
end
|
Class Method Details
.run(i = ARGV) ⇒ Object
223
224
225
226
227
228
229
230
231
232
233
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 223
def self.run(
i = ARGV
)
require 'gtk_paradise/run'
_ = ::GamesAndRpgParadise::GUI::Gtk::ButtonContainingInformationAboutASingleCard.new(i)
r = ::Gtk.run
r << _
r.automatic_size_then_automatic_title
r.enable_quick_exit
r.middle_of_the_screen_then_run
end
|
Instance Method Details
#append_entries_from_this_hash(hash) ⇒ Object
#
append_entries_from_this_hash
#
129
130
131
132
133
134
135
136
137
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 129
def append_entries_from_this_hash(hash)
hash.each_pair {|key, value|
old_text = @button.text?
@button.set_text(
old_text+"\n"+
key.to_s+': '+value.to_s
)
}
end
|
#border_size? ⇒ Boolean
109
110
111
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 109
def border_size?
2
end
|
#connect_skeleton ⇒ Object
#
connect_skeleton (connect tag)
#
199
200
201
202
203
204
205
206
207
208
209
210
211
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 199
def connect_skeleton
abort_on_exception
@button = gtk_button
@button.bblack1
@button.pad8px
@button.on_hover(hover_colour?)
@button.on_clicked {
invoke_the_main_method_of_this_class
}
maximal(
@button
)
end
|
#cost? ⇒ Boolean
159
160
161
162
163
164
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 159
def cost?
_ = text?
_ =~ /cost: (.+)\n/
result = $1.to_s.dup
return result
end
|
#create_skeleton ⇒ Object
#
create_skeleton (create tag)
#
116
117
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 116
def create_skeleton
end
|
#hover_colour? ⇒ Boolean
95
96
97
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 95
def hover_colour?
@hover_colour
end
|
#invoke_the_main_method_of_this_class ⇒ Object
#
invoke_the_main_method_of_this_class
#
186
187
188
189
190
191
192
193
194
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 186
def invoke_the_main_method_of_this_class
_ = @parent_widget
if _
_.entry_for_the_theme?.set_text(theme?)
_.entry1?.set_text(name_of_the_card?)
_.entry4?.set_text(rarity?)
_.entry5?.set_text(cost?)
end
end
|
#name_of_the_card? ⇒ Boolean
179
180
181
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 179
def name_of_the_card?
return text?.split("\n").first.to_s.strip
end
|
#padding? ⇒ Boolean
102
103
104
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 102
def padding?
4
end
|
#rarity? ⇒ Boolean
169
170
171
172
173
174
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 169
def rarity?
_ = text?
_ =~ /rarity: (.+)\n/
result = $1.to_s.dup
return result
end
|
#reset ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 66
def reset
reset_the_internal_variables
@configuration = [true, __dir__, NAMESPACE]
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
use_gtk_paradise_project_css_file
infer_the_size_automatically
@hover_colour = :thistle
@parent_widget = nil
end
|
#run ⇒ Object
216
217
218
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 216
def run
create_skeleton_then_connect_skeleton
end
|
88
89
90
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 88
def set_parent_widget(i)
@parent_widget = i
end
|
#set_text(i) ⇒ Object
122
123
124
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 122
def set_text(i)
@button.set_text(i.to_s)
end
|
#text? ⇒ Boolean
142
143
144
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 142
def text?
@button.text?
end
|
#theme? ⇒ Boolean
149
150
151
152
153
154
|
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/card_collection/button_containing_information_about_a_single_card.rb', line 149
def theme?
_ = text?
_ =~ /theme: (.+)\n/
result = $1.to_s.dup
return result
end
|