Class: GamesAndRpgParadise::GUI::Gtk::GiftButton
- Inherits:
-
Gtk::ToggleButton
- Object
- Gtk::ToggleButton
- GamesAndRpgParadise::GUI::Gtk::GiftButton
show all
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/gift_button.rb
Overview
Constant Summary
collapse
- NAMESPACE =
inspect
- DEFAULT_IMAGE_FILE =
'/home/x/data/images/STD/TURM.png'
- DEFAULT_WIDTH =
55
- DEFAULT_HEIGHT =
55
Instance Method Summary
collapse
Constructor Details
#initialize(optional_text = '') ⇒ GiftButton
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/gift_button.rb', line 47
def initialize(optional_text = '')
super(optional_text)
reset
@active = false
set_size_request(DEFAULT_WIDTH, DEFAULT_HEIGHT)
image = gtk_image(@image_location)
set_image(image)
on_toggled { |w|
if active?
set_image(
gtk_image(DEFAULT_IMAGE_FILE)
)
set_text('')
else
set_active(true)
end
}
end
|
Instance Method Details
#reset ⇒ Object
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/games_and_rpg_paradise/gui/gtk2/xmas_gifts/gift_button.rb', line 74
def reset
reset_the_internal_variables
@configuration = [true, __dir__, NAMESPACE]
@image_location = '/home/x/data/images/STD/UHR.png'
end
|