gtk4 3.4.9 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -2
  3. data/gtk4.gemspec +1 -5
  4. data/lib/gtk4/{menu-item.rb → application.rb} +11 -10
  5. data/lib/gtk4/box.rb +1 -1
  6. data/lib/gtk4/builder.rb +14 -61
  7. data/lib/gtk4/button.rb +1 -2
  8. data/lib/gtk4/combo-box.rb +1 -6
  9. data/lib/gtk4/deprecated.rb +234 -246
  10. data/lib/gtk4/dialog.rb +10 -21
  11. data/lib/gtk4/{action.rb → entry.rb} +11 -8
  12. data/lib/gtk4/{gdk-drag-context.rb → gdk-display.rb} +12 -10
  13. data/lib/gtk4/icon-theme.rb +9 -12
  14. data/lib/gtk4/image.rb +12 -56
  15. data/lib/gtk4/label.rb +1 -1
  16. data/lib/gtk4/list-store.rb +8 -0
  17. data/lib/gtk4/loader.rb +153 -27
  18. data/lib/gtk4/message-dialog.rb +1 -1
  19. data/lib/gtk4/paned.rb +17 -11
  20. data/lib/gtk4/{clipboard.rb → response-type.rb} +11 -6
  21. data/lib/gtk4/ruby-builder-scope.rb +47 -0
  22. data/lib/gtk4/scale-button.rb +6 -13
  23. data/lib/gtk4/stack.rb +23 -27
  24. data/lib/gtk4/style-context.rb +20 -4
  25. data/lib/gtk4/text-buffer.rb +14 -10
  26. data/lib/gtk4/{style-properties.rb → tree-model-sort.rb} +7 -9
  27. data/lib/gtk4/tree-model.rb +21 -1
  28. data/lib/gtk4/{target-list.rb → tree-sortable.rb} +8 -11
  29. data/lib/gtk4/tree-view-column.rb +9 -1
  30. data/lib/gtk4/version.rb +2 -2
  31. data/lib/gtk4/widget.rb +44 -71
  32. data/lib/gtk4.rb +4 -39
  33. data/sample/demos/README.md +4 -0
  34. data/sample/examples/README.md +4 -0
  35. data/sample/{action-namespace.rb → examples/action-namespace.rb} +0 -0
  36. data/sample/{builder.rb → examples/builder.rb} +0 -0
  37. data/sample/{builder.ui → examples/builder.ui} +0 -0
  38. data/sample/{drawing.rb → examples/drawing.rb} +0 -0
  39. data/sample/{grid_packing.rb → examples/grid_packing.rb} +0 -0
  40. data/sample/{hello_world.rb → examples/hello_world.rb} +0 -0
  41. data/sample/{utils.rb → examples/utils.rb} +0 -0
  42. data/sample/getting-started/README.md +4 -0
  43. metadata +27 -93
  44. data/lib/gtk4/action-group.rb +0 -131
  45. data/lib/gtk4/calendar.rb +0 -30
  46. data/lib/gtk4/check-menu-item.rb +0 -34
  47. data/lib/gtk4/container.rb +0 -62
  48. data/lib/gtk4/icon-size.rb +0 -32
  49. data/lib/gtk4/image-menu-item.rb +0 -37
  50. data/lib/gtk4/radio-action.rb +0 -28
  51. data/lib/gtk4/radio-button.rb +0 -49
  52. data/lib/gtk4/recent-chooser-dialog.rb +0 -38
  53. data/lib/gtk4/selection-data.rb +0 -42
  54. data/lib/gtk4/stock-item.rb +0 -36
  55. data/lib/gtk4/stock.rb +0 -70
  56. data/lib/gtk4/table.rb +0 -43
  57. data/lib/gtk4/target-entry.rb +0 -27
  58. data/lib/gtk4/toggle-action.rb +0 -27
  59. data/lib/gtk4/tool-button.rb +0 -36
  60. data/lib/gtk4/ui-manager.rb +0 -35
  61. data/lib/gtk4/window.rb +0 -42
  62. data/test/fixture/gnome-logo-icon.png +0 -0
  63. data/test/gtk-test-utils.rb +0 -36
  64. data/test/run-test.rb +0 -42
  65. data/test/test-gtk-box.rb +0 -36
  66. data/test/test-gtk-button.rb +0 -46
  67. data/test/test-gtk-dialog.rb +0 -74
  68. data/test/test-gtk-menu-item.rb +0 -42
  69. data/test/test-gtk-message-dialog.rb +0 -62
  70. data/test/test-gtk-version.rb +0 -47
  71. data/test/test-gtk-window.rb +0 -34
metadata CHANGED
@@ -1,85 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk4
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.9
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-10 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: gio2
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: 3.4.9
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 3.4.9
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: atk
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - '='
32
18
  - !ruby/object:Gem::Version
33
- version: 3.4.9
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 3.4.9
41
- - !ruby/object:Gem::Dependency
42
- name: pango
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 3.4.9
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 3.4.9
55
- - !ruby/object:Gem::Dependency
56
- name: gdk_pixbuf2
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 3.4.9
19
+ version: 4.0.0
62
20
  type: :runtime
63
21
  prerelease: false
64
22
  version_requirements: !ruby/object:Gem::Requirement
65
23
  requirements:
66
24
  - - '='
67
25
  - !ruby/object:Gem::Version
68
- version: 3.4.9
26
+ version: 4.0.0
69
27
  - !ruby/object:Gem::Dependency
70
28
  name: gdk4
71
29
  requirement: !ruby/object:Gem::Requirement
72
30
  requirements:
73
31
  - - '='
74
32
  - !ruby/object:Gem::Version
75
- version: 3.4.9
33
+ version: 4.0.0
76
34
  type: :runtime
77
35
  prerelease: false
78
36
  version_requirements: !ruby/object:Gem::Requirement
79
37
  requirements:
80
38
  - - '='
81
39
  - !ruby/object:Gem::Version
82
- version: 3.4.9
40
+ version: 4.0.0
83
41
  description: Ruby/GTK4 is a Ruby binding of GTK+-4.x.
84
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
85
43
  executables: []
@@ -92,100 +50,76 @@ files:
92
50
  - gtk4.gemspec
93
51
  - lib/gtk4.rb
94
52
  - lib/gtk4/about-dialog.rb
95
- - lib/gtk4/action-group.rb
96
- - lib/gtk4/action.rb
53
+ - lib/gtk4/application.rb
97
54
  - lib/gtk4/binding-set.rb
98
55
  - lib/gtk4/border.rb
99
56
  - lib/gtk4/box.rb
100
57
  - lib/gtk4/builder.rb
101
58
  - lib/gtk4/button.rb
102
- - lib/gtk4/calendar.rb
103
59
  - lib/gtk4/cell-layout.rb
104
- - lib/gtk4/check-menu-item.rb
105
- - lib/gtk4/clipboard.rb
106
60
  - lib/gtk4/color-chooser-dialog.rb
107
61
  - lib/gtk4/combo-box-text.rb
108
62
  - lib/gtk4/combo-box.rb
109
- - lib/gtk4/container.rb
110
63
  - lib/gtk4/css-provider.rb
111
64
  - lib/gtk4/deprecated.rb
112
65
  - lib/gtk4/dialog.rb
113
66
  - lib/gtk4/entry-buffer.rb
67
+ - lib/gtk4/entry.rb
114
68
  - lib/gtk4/file-chooser-dialog.rb
115
69
  - lib/gtk4/font-chooser-dialog.rb
116
- - lib/gtk4/gdk-drag-context.rb
70
+ - lib/gtk4/gdk-display.rb
117
71
  - lib/gtk4/gesture-multi-press.rb
118
- - lib/gtk4/icon-size.rb
119
72
  - lib/gtk4/icon-theme.rb
120
73
  - lib/gtk4/icon-view.rb
121
- - lib/gtk4/image-menu-item.rb
122
74
  - lib/gtk4/image.rb
123
75
  - lib/gtk4/label.rb
124
76
  - lib/gtk4/level-bar.rb
125
77
  - lib/gtk4/list-store.rb
126
78
  - lib/gtk4/loader.rb
127
- - lib/gtk4/menu-item.rb
128
79
  - lib/gtk4/message-dialog.rb
129
80
  - lib/gtk4/paned.rb
130
- - lib/gtk4/radio-action.rb
131
- - lib/gtk4/radio-button.rb
132
- - lib/gtk4/recent-chooser-dialog.rb
81
+ - lib/gtk4/response-type.rb
82
+ - lib/gtk4/ruby-builder-scope.rb
133
83
  - lib/gtk4/scale-button.rb
134
84
  - lib/gtk4/scrolled-window.rb
135
85
  - lib/gtk4/search-bar.rb
136
- - lib/gtk4/selection-data.rb
137
86
  - lib/gtk4/show-uri.rb
138
87
  - lib/gtk4/spin-button.rb
139
88
  - lib/gtk4/stack.rb
140
- - lib/gtk4/stock-item.rb
141
- - lib/gtk4/stock.rb
142
89
  - lib/gtk4/style-context.rb
143
- - lib/gtk4/style-properties.rb
144
- - lib/gtk4/table.rb
145
- - lib/gtk4/target-entry.rb
146
- - lib/gtk4/target-list.rb
147
90
  - lib/gtk4/text-buffer.rb
148
91
  - lib/gtk4/text-iter.rb
149
92
  - lib/gtk4/text-tag-table.rb
150
93
  - lib/gtk4/text-tag.rb
151
94
  - lib/gtk4/text-view.rb
152
- - lib/gtk4/toggle-action.rb
153
95
  - lib/gtk4/toggle-button.rb
154
- - lib/gtk4/tool-button.rb
155
96
  - lib/gtk4/tree-iter.rb
156
97
  - lib/gtk4/tree-model-filter.rb
98
+ - lib/gtk4/tree-model-sort.rb
157
99
  - lib/gtk4/tree-model.rb
158
100
  - lib/gtk4/tree-path.rb
159
101
  - lib/gtk4/tree-selection.rb
102
+ - lib/gtk4/tree-sortable.rb
160
103
  - lib/gtk4/tree-store.rb
161
104
  - lib/gtk4/tree-view-column.rb
162
105
  - lib/gtk4/tree-view.rb
163
- - lib/gtk4/ui-manager.rb
164
106
  - lib/gtk4/version.rb
165
107
  - lib/gtk4/widget.rb
166
- - lib/gtk4/window.rb
167
- - sample/action-namespace.rb
168
- - sample/builder.rb
169
- - sample/builder.ui
170
- - sample/drawing.rb
171
- - sample/grid_packing.rb
172
- - sample/hello_world.rb
173
- - sample/utils.rb
174
- - test/fixture/gnome-logo-icon.png
175
- - test/gtk-test-utils.rb
176
- - test/run-test.rb
177
- - test/test-gtk-box.rb
178
- - test/test-gtk-button.rb
179
- - test/test-gtk-dialog.rb
180
- - test/test-gtk-menu-item.rb
181
- - test/test-gtk-message-dialog.rb
182
- - test/test-gtk-version.rb
183
- - test/test-gtk-window.rb
108
+ - sample/demos/README.md
109
+ - sample/examples/README.md
110
+ - sample/examples/action-namespace.rb
111
+ - sample/examples/builder.rb
112
+ - sample/examples/builder.ui
113
+ - sample/examples/drawing.rb
114
+ - sample/examples/grid_packing.rb
115
+ - sample/examples/hello_world.rb
116
+ - sample/examples/utils.rb
117
+ - sample/getting-started/README.md
184
118
  homepage: https://ruby-gnome2.osdn.jp/
185
119
  licenses:
186
120
  - LGPL-2.1+
187
121
  metadata: {}
188
- post_install_message:
122
+ post_install_message:
189
123
  rdoc_options: []
190
124
  require_paths:
191
125
  - lib
@@ -200,8 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
134
  - !ruby/object:Gem::Version
201
135
  version: '0'
202
136
  requirements: []
203
- rubygems_version: 3.3.0.dev
204
- signing_key:
137
+ rubygems_version: 3.4.0.dev
138
+ signing_key:
205
139
  specification_version: 4
206
140
  summary: Ruby/GTK4 is a Ruby binding of GTK+-4.x.
207
141
  test_files: []
@@ -1,131 +0,0 @@
1
- # Copyright (C) 2015-2017 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class ActionGroup
19
- alias_method :add_action_raw, :add_action
20
- def add_action(action, options={})
21
- accelerator = options[:accelerator]
22
-
23
- if accelerator
24
- add_action_with_accel(action, accelerator)
25
- else
26
- add_action_raw(action)
27
- end
28
- end
29
-
30
- def add_actions(actions)
31
- actions.each do |config|
32
- if config.is_a?(Array)
33
- name = config[0]
34
- stock_id = config[1]
35
- label = config[2]
36
- accelerator = config[3]
37
- tooltip = config[4]
38
- callback = config[5]
39
- else
40
- name = config[:name]
41
- stock_id = config[:stock_id]
42
- label = config[:label]
43
- accelerator = config[:accelerator]
44
- tooltip = config[:tooltip]
45
- callback = config[:callback]
46
- end
47
-
48
- action = Action.new(name,
49
- :label => translate_string(label),
50
- :tooltip => translate_string(tooltip),
51
- :stock_id => stock_id)
52
- action.signal_connect("activate") do
53
- callback.call(self, action)
54
- end
55
- add_action(action, :accelerator => accelerator)
56
- end
57
- end
58
-
59
- def add_toggle_actions(actions)
60
- actions.each do |config|
61
- if config.is_a?(Array)
62
- name = config[0]
63
- stock_id = config[1]
64
- label = config[2]
65
- accelerator = config[3]
66
- tooltip = config[4]
67
- callback = config[5]
68
- is_active = config[6]
69
- else
70
- name = config[:name]
71
- stock_id = config[:stock_id]
72
- label = config[:label]
73
- accelerator = config[:accelerator]
74
- tooltip = config[:tooltip]
75
- callback = config[:callback]
76
- is_active = config[:is_active]
77
- end
78
-
79
- action = ToggleAction.new(name,
80
- :label => translate_string(label),
81
- :tooltip => translate_string(tooltip),
82
- :stock_id => stock_id)
83
- action.active = true if is_active
84
- action.signal_connect("activate") do
85
- callback.call(self, action)
86
- end
87
- add_action(action, :accelerator => accelerator)
88
- end
89
- end
90
-
91
- def add_radio_actions(actions, default_value=nil)
92
- actions.each_with_index do |config, i|
93
- if config.is_a?(Array)
94
- name = config[0]
95
- stock_id = config[1]
96
- label = config[2]
97
- accelerator = config[3]
98
- tooltip = config[4]
99
- value = config[5]
100
- else
101
- name = config[:name]
102
- stock_id = config[:stock_id]
103
- label = config[:label]
104
- accelerator = config[:accelerator]
105
- tooltip = config[:tooltip]
106
- value = config[:value]
107
- end
108
-
109
- action = RadioAction.new(name,
110
- value,
111
- :label => translate_string(label),
112
- :tooltip => translate_string(tooltip),
113
- :stock_id => stock_id)
114
- action.active = true if value == default_value
115
- if i.zero?
116
- action.signal_connect("changed") do |connected_action, current_action|
117
- yield(connected_action, current_action)
118
- end
119
- end
120
- add_action(action, :accelerator => accelerator)
121
- end
122
- end
123
-
124
- alias_method :translate_string_raw, :translate_string
125
- def translate_string(string)
126
- return nil if string.nil?
127
-
128
- translate_string_raw(string)
129
- end
130
- end
131
- end
data/lib/gtk4/calendar.rb DELETED
@@ -1,30 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class Calendar
19
- alias_method :select_month_raw, :select_month
20
- def select_month(month, year)
21
- select_month_raw(month - 1, year)
22
- end
23
-
24
- alias_method :date_raw, :date
25
- def date
26
- year, month, day = date_raw
27
- [year, month + 1, day]
28
- end
29
- end
30
- end
@@ -1,34 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class CheckMenuItem
19
- alias_method :initialize_raw, :initialize
20
- def initialize(options={})
21
- label = options[:label]
22
-
23
- if label
24
- if options[:use_underline]
25
- initialize_new_with_mnemonic(label)
26
- else
27
- initialize_new_with_label(label)
28
- end
29
- else
30
- initialize_raw
31
- end
32
- end
33
- end
34
- end
@@ -1,62 +0,0 @@
1
- # Copyright (C) 2014-2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class Container
19
- alias_method :add_raw, :add
20
- def add(child, properties={})
21
- child.freeze_child_notify
22
- begin
23
- add_raw(child)
24
- properties.each do |key, value|
25
- child_set_property(child, key, value)
26
- end
27
- self
28
- ensure
29
- child.thaw_child_notify
30
- end
31
- end
32
- alias_method :<<, :add
33
-
34
- def add_child(*args)
35
- if args.size == 1
36
- add(*args)
37
- else
38
- super
39
- end
40
- end
41
-
42
- alias_method :remove_child, :remove
43
-
44
- alias_method :focus_chain_raw, :focus_chain
45
- def focus_chain
46
- set_explicitly, widgets = focus_chain_raw
47
- if set_explicitly
48
- widgets
49
- else
50
- nil
51
- end
52
- end
53
-
54
- alias_method :child_get_property_raw, :child_get_property
55
- def child_get_property(child, name)
56
- property = self.class.find_child_property(name)
57
- value = GLib::Value.new(property.value_type)
58
- child_get_property_raw(child, name, value)
59
- value.value
60
- end
61
- end
62
- end
@@ -1,32 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class IconSize
19
- class << self
20
- alias_method :lookup_raw, :lookup
21
- def lookup(size)
22
- size = new(size) unless size.is_a?(self)
23
- valid, width, height = lookup_raw(size)
24
- if valid
25
- [width, height]
26
- else
27
- nil
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,37 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class ImageMenuItem
19
- alias_method :initialize_raw, :initialize
20
- def initialize(options={})
21
- stock = options[:stock] || nil
22
- label = options[:label] || nil
23
-
24
- if stock
25
- initialize_new_from_stock(stock)
26
- elsif label
27
- if options[:use_underline]
28
- initialize_new_with_mnemonic(label)
29
- else
30
- initialize_new_with_label(label)
31
- end
32
- else
33
- initialize_raw
34
- end
35
- end
36
- end
37
- end
@@ -1,28 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class RadioAction
19
- alias_method :initialize_raw, :initialize
20
- def initialize(name, value, options={})
21
- initialize_raw(name,
22
- options[:label],
23
- options[:tooltip],
24
- options[:stock_id],
25
- value)
26
- end
27
- end
28
- end
@@ -1,49 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class RadioButton
19
- alias_method :initialize_raw, :initialize
20
- def initialize(options={})
21
- group = options[:group]
22
- label = options[:label]
23
- member = options[:member]
24
- use_underline = options[:use_underline]
25
-
26
- if label
27
- if member
28
- if use_underline
29
- initialize_new_with_mnemonic_from_widget(member, label)
30
- else
31
- initialize_new_with_label_from_widget(member, label)
32
- end
33
- else
34
- if use_underline
35
- initialize_new_with_mnemonic(group, label)
36
- else
37
- initialize_new_with_label(group, label)
38
- end
39
- end
40
- else
41
- if member
42
- initialize_new_from_widget(member)
43
- else
44
- initialize_raw
45
- end
46
- end
47
- end
48
- end
49
- end
@@ -1,38 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- module Gtk
18
- class RecentChooserDialog
19
- alias_method :initialize_raw, :initialize
20
- def initialize(options={})
21
- initialize_options = {
22
- :recent_manager => options[:recent_manager],
23
- }
24
- gobject_initialize = GLib::Object.instance_method(:initialize).bind(self)
25
- gobject_initialize.call(initialize_options)
26
- Loader.reference_gobject(self, :sink => true)
27
-
28
- title = options[:title]
29
- parent = options[:parent]
30
- buttons = options[:buttons]
31
-
32
- set_title(title) if title
33
- set_transient_for(parent) if parent
34
-
35
- add_buttons(*buttons) if buttons
36
- end
37
- end
38
- end