gtk3 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +5 -0
- data/lib/gtk3.rb +5 -1
- data/lib/gtk3/calendar.rb +6 -0
- data/lib/gtk3/check-menu-item.rb +34 -0
- data/lib/gtk3/deprecated.rb +36 -8
- data/lib/gtk3/dialog.rb +9 -0
- data/lib/gtk3/image-menu-item.rb +37 -0
- data/lib/gtk3/image.rb +8 -2
- data/lib/gtk3/loader.rb +3 -0
- data/lib/gtk3/table.rb +41 -0
- data/lib/gtk3/text-buffer.rb +23 -1
- data/lib/gtk3/tree-iter.rb +5 -1
- data/lib/gtk3/tree-model.rb +5 -0
- data/lib/gtk3/window.rb +13 -0
- data/sample/misc/application.rb +5 -1
- data/sample/misc/colorchooser.rb +22 -0
- data/sample/misc/scalebutton.rb +1 -1
- data/sample/misc/tooltips.rb +1 -1
- data/sample/tutorial/exampleapp8/exampleapp.rb +2 -2
- data/sample/tutorial/exampleapp9/exampleapp.rb +1 -1
- data/test/test-calendar.rb +30 -0
- data/test/test-check-menu-item.rb +40 -0
- data/test/test-gtk-image.rb +5 -0
- data/test/test-gtk-tree-iter.rb +9 -0
- data/test/test-gtk-window.rb +34 -0
- metadata +23 -17
- data/sample/misc/colorselection.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21d47fea19a0adea93eed76710e32dd1459ebe2
|
4
|
+
data.tar.gz: 56ce6b8cec87d6b3efd5dbc7bf5a71845d51a2f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 341791e3993716188f5e52be1618993862e23c10d074b8a6ddff699c2fe938b60bdc736497585c9384d6253acf012eff56eaa70e1011a91a102aa4a9114ef611
|
7
|
+
data.tar.gz: 2a9ae3f1d4087015391e3c9b0606d4822315a2f6db6f9257ba4c5d882a45cc6f2d44d6e268abbdeeb209133ee904e72382359f165a8391b2bd75ec949624ae0c
|
data/Rakefile
CHANGED
@@ -17,5 +17,10 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
17
17
|
]
|
18
18
|
package.windows.packages = []
|
19
19
|
package.windows.dependencies = []
|
20
|
+
package.cross_compiling do |spec|
|
21
|
+
if /mingw|mswin/ =~ spec.platform.to_s
|
22
|
+
spec.add_runtime_dependency("rsvg2", ">= #{package.version}")
|
23
|
+
end
|
24
|
+
end
|
20
25
|
end
|
21
26
|
package_task.define
|
data/lib/gtk3.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2006-
|
1
|
+
# Copyright (C) 2006-2015 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -26,6 +26,10 @@ GLib.prepend_dll_path(vendor_bin_dir)
|
|
26
26
|
vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
|
27
27
|
GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
|
28
28
|
|
29
|
+
if vendor_dir.exist?
|
30
|
+
require "rsvg2"
|
31
|
+
end
|
32
|
+
|
29
33
|
require "gtk3/loader"
|
30
34
|
|
31
35
|
module Gtk
|
data/lib/gtk3/calendar.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
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
|
data/lib/gtk3/deprecated.rb
CHANGED
@@ -10,6 +10,7 @@ module Gtk
|
|
10
10
|
define_deprecated_const :FontSelectionDialog, :raise => "Use 'Gtk::FontChooserDialog' instead."
|
11
11
|
remove_const(:ColorSelection)
|
12
12
|
define_deprecated_const :ColorSelection, :raise => "Use 'Gtk::ColorChooserWidget' instead."
|
13
|
+
remove_const(:ColorSelectionDialog)
|
13
14
|
define_deprecated_const :ColorSelectionDialog, :raise => "Use 'Gtk::ColorChooserDialog' instead."
|
14
15
|
define_deprecated_const :GammaCurve, :raise => "Don't use this widget anymore."
|
15
16
|
define_deprecated_const :HRuler, :raise => "Don't use this widget anymore."
|
@@ -113,6 +114,11 @@ module Gtk
|
|
113
114
|
end
|
114
115
|
end
|
115
116
|
|
117
|
+
class Alignment
|
118
|
+
extend GLib::Deprecatable
|
119
|
+
define_deprecated_const :Align, "Gtk::Align"
|
120
|
+
end
|
121
|
+
|
116
122
|
class Arrow
|
117
123
|
extend GLib::Deprecatable
|
118
124
|
define_deprecated_enums :Type
|
@@ -187,7 +193,8 @@ module Gtk
|
|
187
193
|
|
188
194
|
class ButtonBox
|
189
195
|
extend GLib::Deprecatable
|
190
|
-
|
196
|
+
define_deprecated_const :Style, "Gtk::ButtonBoxStyle"
|
197
|
+
define_deprecated_enums "Gtk::ButtonBoxStyle", "STYLE"
|
191
198
|
end
|
192
199
|
|
193
200
|
class Calendar
|
@@ -223,12 +230,12 @@ module Gtk
|
|
223
230
|
define_deprecated_method :get_size_of_row, :raise => "Use Gtk::Widget#get_preferred_size."
|
224
231
|
end
|
225
232
|
|
226
|
-
class
|
233
|
+
class CheckMenuItem
|
227
234
|
extend GLib::Deprecatable
|
228
|
-
define_deprecated_method :colorsel, :color_selection
|
229
235
|
define_deprecated_method_by_hash_args :initialize,
|
230
|
-
|
231
|
-
|
236
|
+
"label, use_underline=false",
|
237
|
+
":label => label, :use_underline => use_underline" do |_self, label, use_underline|
|
238
|
+
[{:label => label, :use_underline => use_underline}]
|
232
239
|
end
|
233
240
|
end
|
234
241
|
|
@@ -253,6 +260,7 @@ module Gtk
|
|
253
260
|
class Container
|
254
261
|
extend GLib::Deprecatable
|
255
262
|
define_deprecated_singleton_method :child_property, :find_child_property
|
263
|
+
define_deprecated_method :each_forall, :each_all
|
256
264
|
end
|
257
265
|
|
258
266
|
class Dialog
|
@@ -515,12 +523,17 @@ module Gtk
|
|
515
523
|
end
|
516
524
|
when Symbol
|
517
525
|
[{:stock => image, :size => size}]
|
526
|
+
when Gdk::Pixbuf
|
527
|
+
[{:pixbuf => image}]
|
518
528
|
when Gtk::IconSet
|
519
529
|
[{:icon_set => image, :size => size}]
|
520
530
|
when Gio::Icon
|
521
531
|
[{:icon => image, :size => size}]
|
522
532
|
else
|
523
|
-
|
533
|
+
message =
|
534
|
+
"Image must be String, Symbol, Gdk::Pixbuf, Gtk::IconSet or " +
|
535
|
+
"Gio::Icon: #{image.inspect}"
|
536
|
+
raise ArgumentError, message
|
524
537
|
end
|
525
538
|
end
|
526
539
|
end
|
@@ -583,7 +596,8 @@ module Gtk
|
|
583
596
|
|
584
597
|
class MessageDialog
|
585
598
|
extend GLib::Deprecatable
|
586
|
-
|
599
|
+
define_deprecated_const :ButtonsType, "Gtk::ButtonsType"
|
600
|
+
define_deprecated_enums "Gtk::ButtonsType", "BUTTONS"
|
587
601
|
define_deprecated_const :Type, 'Gtk::MessageType'
|
588
602
|
define_deprecated_enums 'Gtk::MessageType'
|
589
603
|
define_deprecated_method_by_hash_args :initialize,
|
@@ -842,7 +856,8 @@ module Gtk
|
|
842
856
|
|
843
857
|
class TextTag
|
844
858
|
extend GLib::Deprecatable
|
845
|
-
|
859
|
+
define_deprecated_const :WrapMode, "Gtk::WrapMode"
|
860
|
+
define_deprecated_enums "Gtk::WrapMode", "WRAP"
|
846
861
|
end
|
847
862
|
|
848
863
|
class TextView
|
@@ -860,8 +875,19 @@ module Gtk
|
|
860
875
|
end
|
861
876
|
end
|
862
877
|
|
878
|
+
class ToggleButton
|
879
|
+
extend GLib::Deprecatable
|
880
|
+
define_deprecated_method_by_hash_args :initialize,
|
881
|
+
'label=nil, use_underline=nil',
|
882
|
+
':label => label, :use_underline => use_underline', 0 do
|
883
|
+
|_self, label, use_underline|
|
884
|
+
[{:label => label, :use_underline => use_underline}]
|
885
|
+
end
|
886
|
+
end
|
887
|
+
|
863
888
|
class Toolbar
|
864
889
|
extend GLib::Deprecatable
|
890
|
+
define_deprecated_const :Style, "Gtk::ToolbarStyle"
|
865
891
|
define_deprecated_method :append, :warn => "Don't use this method."
|
866
892
|
define_deprecated_method :prepend, :warn => "Don't use this method."
|
867
893
|
define_deprecated_method :item_index, :get_item_index
|
@@ -977,6 +1003,7 @@ module Gtk
|
|
977
1003
|
|
978
1004
|
class Widget
|
979
1005
|
extend GLib::Deprecatable
|
1006
|
+
define_deprecated_const :Align, "Gtk::Align"
|
980
1007
|
define_deprecated_const :HelpType, "Gtk::WidgetHelpType"
|
981
1008
|
define_deprecated_enums :WidgetHelpType, 'HELP'
|
982
1009
|
define_deprecated_const :TextDirection, "Gtk::TextDIrection"
|
@@ -995,6 +1022,7 @@ module Gtk
|
|
995
1022
|
define_deprecated_method :set_flags, :warn => "Use the proper method."
|
996
1023
|
alias :flags= :set_flags
|
997
1024
|
define_deprecated_method :unset_flags, :warn => "Use the proper method."
|
1025
|
+
define_deprecated_method :get_size_request, :size_request
|
998
1026
|
define_deprecated_method :no_window?, :warn => "Use '#{self}#has_window?'." do |_self|
|
999
1027
|
!_self.has_window?
|
1000
1028
|
end
|
data/lib/gtk3/dialog.rb
CHANGED
@@ -54,6 +54,15 @@ module Gtk
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
+
alias_method :add_button_raw, :add_button
|
58
|
+
def add_button(text, response_id)
|
59
|
+
case response_id
|
60
|
+
when Symbol
|
61
|
+
response_id = ResponseType.new(response_id)
|
62
|
+
end
|
63
|
+
add_button_raw(text, response_id)
|
64
|
+
end
|
65
|
+
|
57
66
|
if method_defined?(:use_header_bar)
|
58
67
|
alias_method :use_header_bar_raw, :use_header_bar
|
59
68
|
undef_method :use_header_bar
|
@@ -0,0 +1,37 @@
|
|
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
|
data/lib/gtk3/image.rb
CHANGED
@@ -24,6 +24,9 @@ module Gtk
|
|
24
24
|
# Gdk::Pixbuf, Gdk::PixbufAnimation, Cairo::Surface,
|
25
25
|
# Fixnum}
|
26
26
|
#
|
27
|
+
# @example Create an empty image.
|
28
|
+
# image = Gtk::Image.new
|
29
|
+
#
|
27
30
|
# @example Create an image from a file.
|
28
31
|
# image = Gtk::Image.new :file => 'path/to/the/image.png'
|
29
32
|
#
|
@@ -84,7 +87,10 @@ module Gtk
|
|
84
87
|
|
85
88
|
case size
|
86
89
|
when String, Symbol
|
87
|
-
|
90
|
+
size_name = size.to_s.gsub(/_/, "-")
|
91
|
+
size = Gtk.icon_size_from_name("gtk-#{size_name}")
|
92
|
+
else
|
93
|
+
size ||= Gtk::IconSize::BUTTON
|
88
94
|
end
|
89
95
|
|
90
96
|
if stock
|
@@ -106,7 +112,7 @@ module Gtk
|
|
106
112
|
elsif surface
|
107
113
|
initialize_new_from_surface(surface)
|
108
114
|
else
|
109
|
-
|
115
|
+
initialize_raw
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
data/lib/gtk3/loader.rb
CHANGED
@@ -99,6 +99,7 @@ module Gtk
|
|
99
99
|
require "gtk3/builder"
|
100
100
|
require "gtk3/calendar"
|
101
101
|
require "gtk3/cell-layout"
|
102
|
+
require "gtk3/check-menu-item"
|
102
103
|
require "gtk3/clipboard"
|
103
104
|
require "gtk3/color-chooser-dialog"
|
104
105
|
require "gtk3/combo-box"
|
@@ -112,6 +113,7 @@ module Gtk
|
|
112
113
|
require "gtk3/icon-theme"
|
113
114
|
require "gtk3/icon-view"
|
114
115
|
require "gtk3/image"
|
116
|
+
require "gtk3/image-menu-item"
|
115
117
|
require "gtk3/label"
|
116
118
|
require "gtk3/level-bar"
|
117
119
|
require "gtk3/list-store"
|
@@ -130,6 +132,7 @@ module Gtk
|
|
130
132
|
require "gtk3/stock"
|
131
133
|
require "gtk3/style-context"
|
132
134
|
require "gtk3/style-properties"
|
135
|
+
require "gtk3/table"
|
133
136
|
require "gtk3/target-list"
|
134
137
|
require "gtk3/target-entry"
|
135
138
|
require "gtk3/text-buffer"
|
data/lib/gtk3/table.rb
ADDED
@@ -0,0 +1,41 @@
|
|
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 Table
|
19
|
+
alias_method :initialize_raw, :initialize
|
20
|
+
def initialize(n_rows, n_columns, homogeneous=false)
|
21
|
+
initialize_raw(n_rows, n_columns, homogeneous)
|
22
|
+
end
|
23
|
+
|
24
|
+
alias_method :default_column_spacing, :default_col_spacing
|
25
|
+
|
26
|
+
def column_spacings(column)
|
27
|
+
get_col_spacings(column)
|
28
|
+
end
|
29
|
+
alias_method :set_column_spacings, :set_col_spacings
|
30
|
+
alias_method :column_spacings=, :col_spacings=
|
31
|
+
|
32
|
+
alias_method :attach_raw, :attach
|
33
|
+
def attach(child, left, right, top, bottom,
|
34
|
+
x_options=nil, y_options=nil,
|
35
|
+
x_space=nil, y_space=nil)
|
36
|
+
attach_raw(child, left, right, top, bottom,
|
37
|
+
x_options, y_options,
|
38
|
+
x_space || 0, y_space || 0)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/gtk3/text-buffer.rb
CHANGED
@@ -66,7 +66,29 @@ module Gtk
|
|
66
66
|
alias_method :insert_raw, :insert
|
67
67
|
alias_method :insert_pixbuf_raw, :insert_pixbuf
|
68
68
|
alias_method :insert_child_anchor_raw, :insert_child_anchor
|
69
|
-
def insert(iter, target,
|
69
|
+
def insert(iter, target, *args)
|
70
|
+
options = nil
|
71
|
+
tags = nil
|
72
|
+
case args.size
|
73
|
+
when 0
|
74
|
+
options = {}
|
75
|
+
when 1
|
76
|
+
case args.first
|
77
|
+
when Hash
|
78
|
+
options = args.first
|
79
|
+
else
|
80
|
+
tags = args
|
81
|
+
end
|
82
|
+
else
|
83
|
+
tags = args
|
84
|
+
end
|
85
|
+
if options.nil?
|
86
|
+
signature_prefix = "#{self.class}\##{__method__}(iter, target"
|
87
|
+
warn("#{signature_prefix}, *tags) style has been deprecated. " +
|
88
|
+
"Use #{signature_prefix}, options={:tags => tags}) style instead.")
|
89
|
+
options = {:tags => tags}
|
90
|
+
end
|
91
|
+
|
70
92
|
interactive = options[:interactive]
|
71
93
|
default_editable = options[:default_editable]
|
72
94
|
tags = options[:tags]
|
data/lib/gtk3/tree-iter.rb
CHANGED
@@ -25,7 +25,7 @@ module Gtk
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def get_value(column)
|
28
|
-
@model.get_value(self, column)
|
28
|
+
@model.get_value(self, column)
|
29
29
|
end
|
30
30
|
alias_method :[], :get_value
|
31
31
|
|
@@ -43,6 +43,10 @@ module Gtk
|
|
43
43
|
@model.get_path(self)
|
44
44
|
end
|
45
45
|
|
46
|
+
def next!
|
47
|
+
@model.iter_next(self)
|
48
|
+
end
|
49
|
+
|
46
50
|
def ==(other)
|
47
51
|
other.is_a?(self.class) and
|
48
52
|
@model == other.model and
|
data/lib/gtk3/tree-model.rb
CHANGED
data/lib/gtk3/window.rb
CHANGED
@@ -25,5 +25,18 @@ module Gtk
|
|
25
25
|
initialize_raw(type)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
alias_method :set_icon_raw, :set_icon
|
30
|
+
def set_icon(icon_or_file_name)
|
31
|
+
case icon_or_file_name
|
32
|
+
when String
|
33
|
+
set_icon_from_file(icon_or_file_name)
|
34
|
+
else
|
35
|
+
set_icon_raw(icon_or_file_name)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
remove_method :icon=
|
40
|
+
alias_method :icon=, :set_icon
|
28
41
|
end
|
29
42
|
end
|
data/sample/misc/application.rb
CHANGED
@@ -7,7 +7,11 @@
|
|
7
7
|
=end
|
8
8
|
|
9
9
|
require "gtk3"
|
10
|
-
myapp = Gtk::Application.new("org.gtk.example", :
|
10
|
+
myapp = Gtk::Application.new("org.gtk.example", :handles_command_line)
|
11
|
+
myapp.signal_connect "command-line" do |app, command_line|
|
12
|
+
app.activate
|
13
|
+
0
|
14
|
+
end
|
11
15
|
|
12
16
|
myapp.signal_connect "activate" do |app|
|
13
17
|
win = Gtk::ApplicationWindow.new(app)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
=begin
|
2
|
+
colorchooser.rb - Gtk::ColorChooserWidget sample script.
|
3
|
+
|
4
|
+
Copyright (c) 2015 Ruby-GNOME2 Project Team
|
5
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
+
=end
|
7
|
+
|
8
|
+
require "gtk3"
|
9
|
+
|
10
|
+
color_selection = Gtk::ColorChooserWidget.new
|
11
|
+
color_selection.use_alpha = true
|
12
|
+
color_selection.signal_connect "color-activated" do |widget, color|
|
13
|
+
p color.to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
window = Gtk::Window.new
|
17
|
+
window.border_width = 10
|
18
|
+
window.add(color_selection)
|
19
|
+
window.show_all
|
20
|
+
window.signal_connect("destroy") {Gtk.main_quit}
|
21
|
+
|
22
|
+
Gtk.main
|
data/sample/misc/scalebutton.rb
CHANGED
@@ -22,7 +22,7 @@ box.hexpand = true
|
|
22
22
|
window.add(box)
|
23
23
|
# see here for an explication on icons order
|
24
24
|
# https://developer.gnome.org/gtk3/stable/GtkScaleButton.html#GtkScaleButton--icons
|
25
|
-
scale.set_icons(%w(
|
25
|
+
scale.set_icons(%w(go-bottom go-top system-run))
|
26
26
|
scale.signal_connect("value-changed") { |_widget, value| puts "value changed: #{value}" }
|
27
27
|
|
28
28
|
window.show_all
|
data/sample/misc/tooltips.rb
CHANGED
@@ -25,7 +25,7 @@ def treeview_query_tooltip(treeview, keyboard_tip, x, y, tooltip)
|
|
25
25
|
else
|
26
26
|
bin_x, bin_y = treeview.convert_widget_to_bin_window_coords(x, y)
|
27
27
|
# Mouse mode
|
28
|
-
path = treeview.get_path_at_pos(bin_x, bin_y)
|
28
|
+
path, = treeview.get_path_at_pos(bin_x, bin_y)
|
29
29
|
if not path
|
30
30
|
return false
|
31
31
|
end
|
@@ -157,8 +157,8 @@ class ExampleAppWindow < Gtk::ApplicationWindow
|
|
157
157
|
sidebar,
|
158
158
|
"reveal-child",
|
159
159
|
Gio::SettingsBindFlags::DEFAULT)
|
160
|
-
sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec
|
161
|
-
update_words(
|
160
|
+
sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec|
|
161
|
+
update_words(self)
|
162
162
|
end
|
163
163
|
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/gears-menu.ui")
|
164
164
|
menu = builder.get_object("menu")
|
@@ -174,7 +174,7 @@ class ExampleAppWindow < Gtk::ApplicationWindow
|
|
174
174
|
sidebar,
|
175
175
|
"reveal-child",
|
176
176
|
Gio::SettingsBindFlags::DEFAULT)
|
177
|
-
sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec
|
177
|
+
sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec|
|
178
178
|
update_words(self)
|
179
179
|
end
|
180
180
|
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/gears-menu.ui")
|
@@ -0,0 +1,30 @@
|
|
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
|
+
class TestGtkCalendar < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
@calendar = Gtk::Calendar.new
|
22
|
+
end
|
23
|
+
|
24
|
+
test "accessor" do
|
25
|
+
@calendar.select_month(12, 2015)
|
26
|
+
@calendar.select_day(31)
|
27
|
+
assert_equal([2015, 12, 31],
|
28
|
+
@calendar.date)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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
|
+
class TestGtkCheckMenuItem < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
sub_test_case(".new") do
|
21
|
+
test "no argument" do
|
22
|
+
item = Gtk::CheckMenuItem.new
|
23
|
+
assert_equal("", item.label)
|
24
|
+
end
|
25
|
+
|
26
|
+
test ":label" do
|
27
|
+
label = "_Button"
|
28
|
+
button = Gtk::CheckMenuItem.new(:label => label)
|
29
|
+
assert_equal(label, button.label)
|
30
|
+
end
|
31
|
+
|
32
|
+
test ":use_underline" do
|
33
|
+
button = Gtk::CheckMenuItem.new(:label => "_Button",
|
34
|
+
:use_underline => true)
|
35
|
+
assert do
|
36
|
+
button.use_underline?
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/test/test-gtk-image.rb
CHANGED
@@ -2,6 +2,11 @@ class TestGtkImage < Test::Unit::TestCase
|
|
2
2
|
include GtkTestUtils
|
3
3
|
|
4
4
|
sub_test_case ".new" do
|
5
|
+
test "empty" do
|
6
|
+
image = Gtk::Image.new
|
7
|
+
assert_equal(nil, image.pixbuf)
|
8
|
+
end
|
9
|
+
|
5
10
|
test "stock" do
|
6
11
|
image = Gtk::Image.new(:stock => Gtk::Stock::GO_FORWARD,
|
7
12
|
:size => :dialog)
|
data/test/test-gtk-tree-iter.rb
CHANGED
@@ -50,4 +50,13 @@ class TestGtkTreeIter < Test::Unit::TestCase
|
|
50
50
|
assert_equal("string", @iter[0])
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
test "#next!" do
|
55
|
+
next_iter = @model.append
|
56
|
+
@iter.values = ["first"]
|
57
|
+
next_iter.values = ["second"]
|
58
|
+
assert_equal("first", @iter[0])
|
59
|
+
@iter.next!
|
60
|
+
assert_equal("second", @iter[0])
|
61
|
+
end
|
53
62
|
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
class TestGtkWindow < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
@window = Gtk::Window.new
|
22
|
+
end
|
23
|
+
|
24
|
+
sub_test_case "#icon=" do
|
25
|
+
test "String" do
|
26
|
+
@window.icon = fixture_path("gnome-logo-icon.png")
|
27
|
+
end
|
28
|
+
|
29
|
+
test "Gdk::Pixbuf" do
|
30
|
+
icon = Gdk::Pixbuf.new(fixture_path("gnome-logo-icon.png"))
|
31
|
+
@window.icon = icon
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,98 +16,98 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.
|
19
|
+
version: 3.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0.
|
26
|
+
version: 3.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gio2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.
|
33
|
+
version: 3.0.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0.
|
40
|
+
version: 3.0.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: atk
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.0.
|
47
|
+
version: 3.0.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.0.
|
54
|
+
version: 3.0.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pango
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.0.
|
61
|
+
version: 3.0.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.0.
|
68
|
+
version: 3.0.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: gdk_pixbuf2
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.0.
|
75
|
+
version: 3.0.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.0.
|
82
|
+
version: 3.0.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: gdk3
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.0.
|
89
|
+
version: 3.0.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.0.
|
96
|
+
version: 3.0.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: gobject-introspection
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.0.
|
103
|
+
version: 3.0.2
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.0.
|
110
|
+
version: 3.0.2
|
111
111
|
description: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|
112
112
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
113
113
|
executables: []
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/gtk3/button.rb
|
136
136
|
- lib/gtk3/calendar.rb
|
137
137
|
- lib/gtk3/cell-layout.rb
|
138
|
+
- lib/gtk3/check-menu-item.rb
|
138
139
|
- lib/gtk3/clipboard.rb
|
139
140
|
- lib/gtk3/color-chooser-dialog.rb
|
140
141
|
- lib/gtk3/combo-box-text.rb
|
@@ -149,6 +150,7 @@ files:
|
|
149
150
|
- lib/gtk3/gesture-multi-press.rb
|
150
151
|
- lib/gtk3/icon-theme.rb
|
151
152
|
- lib/gtk3/icon-view.rb
|
153
|
+
- lib/gtk3/image-menu-item.rb
|
152
154
|
- lib/gtk3/image.rb
|
153
155
|
- lib/gtk3/label.rb
|
154
156
|
- lib/gtk3/level-bar.rb
|
@@ -169,6 +171,7 @@ files:
|
|
169
171
|
- lib/gtk3/stock.rb
|
170
172
|
- lib/gtk3/style-context.rb
|
171
173
|
- lib/gtk3/style-properties.rb
|
174
|
+
- lib/gtk3/table.rb
|
172
175
|
- lib/gtk3/target-entry.rb
|
173
176
|
- lib/gtk3/target-list.rb
|
174
177
|
- lib/gtk3/text-buffer.rb
|
@@ -284,7 +287,7 @@ files:
|
|
284
287
|
- sample/misc/cairo-pong.rb
|
285
288
|
- sample/misc/calendar.rb
|
286
289
|
- sample/misc/checkbutton.rb
|
287
|
-
- sample/misc/
|
290
|
+
- sample/misc/colorchooser.rb
|
288
291
|
- sample/misc/combo-check.rb
|
289
292
|
- sample/misc/combobox-from-cellrender.rb
|
290
293
|
- sample/misc/combobox.rb
|
@@ -406,6 +409,8 @@ files:
|
|
406
409
|
- test/fixture/simple_window.ui
|
407
410
|
- test/gtk-test-utils.rb
|
408
411
|
- test/run-test.rb
|
412
|
+
- test/test-calendar.rb
|
413
|
+
- test/test-check-menu-item.rb
|
409
414
|
- test/test-gc.rb
|
410
415
|
- test/test-gdk-display.rb
|
411
416
|
- test/test-gdk-event.rb
|
@@ -483,6 +488,7 @@ files:
|
|
483
488
|
- test/test-gtk-tree-view.rb
|
484
489
|
- test/test-gtk-version.rb
|
485
490
|
- test/test-gtk-widget.rb
|
491
|
+
- test/test-gtk-window.rb
|
486
492
|
- test/test-gtk.rb
|
487
493
|
homepage: http://ruby-gnome2.sourceforge.jp/
|
488
494
|
licenses:
|
@@ -1,23 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
colorselection.rb - Gtk::ColorSelection sample script.
|
3
|
-
|
4
|
-
Copyright (C) 2005-2015 Masao Mutoh
|
5
|
-
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
-
=end
|
7
|
-
|
8
|
-
require "gtk3"
|
9
|
-
|
10
|
-
color_selection = Gtk::ColorSelection.new
|
11
|
-
color_selection.has_palette = true
|
12
|
-
color_selection.signal_connect("color_changed") do |widget|
|
13
|
-
unless widget.adjusting?
|
14
|
-
p widget.current_rgba.to_s
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
window = Gtk::Window.new
|
19
|
-
window.add(color_selection)
|
20
|
-
window.show_all
|
21
|
-
window.signal_connect("destroy") {Gtk.main_quit}
|
22
|
-
|
23
|
-
Gtk.main
|