gtk3 3.0.3-x64-mingw32 → 3.0.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gtk3/extconf.rb +1 -0
- data/lib/2.0/gtk3.so +0 -0
- data/lib/2.1/gtk3.so +0 -0
- data/lib/2.2/gtk3.so +0 -0
- data/sample/tutorial/README.md +82 -0
- data/test/gtk-test-utils.rb +8 -0
- data/test/test-gtk-color-chooser-dialog.rb +1 -1
- data/test/test-gtk-font-chooser-dialog.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c5cc66546c34fd5e7695fc3cbf536eba70922ed
|
4
|
+
data.tar.gz: 0dcb1aabdf43586be86a462ed551d39b753556bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af5f7e181b1e2634797ac27c98c878858237969364e798bb671b1c9c164144e2762d3406f1f7b1e27022b7d4db3bd889a135807a08b7e45ba69084559a6278f1
|
7
|
+
data.tar.gz: 7ef02574602bd238032d1753143e1c426b867a058365a75c4e6501b3093be36325e0cacf2173adf2131674e24ed0dbea298f8523a992246d3c053d8b4d07518f
|
data/ext/gtk3/extconf.rb
CHANGED
data/lib/2.0/gtk3.so
CHANGED
Binary file
|
data/lib/2.1/gtk3.so
CHANGED
Binary file
|
data/lib/2.2/gtk3.so
CHANGED
Binary file
|
data/sample/tutorial/README.md
CHANGED
@@ -435,6 +435,88 @@ https://developer.gnome.org/gtk3/stable/ch01s04.html#id-1.2.3.12.7
|
|
435
435
|
|
436
436
|
* exampleapp3/exampleapp.rb
|
437
437
|
|
438
|
+
In this step, we make our application show the content of all the files that it is given on the commandline.
|
439
|
+
To this end, we need to easily access widgets from the template. So we use the method `Gtk::Widget.bind_template_child` like in the code below:
|
440
|
+
|
441
|
+
```ruby
|
442
|
+
class ExampleAppWindow < Gtk::ApplicationWindow
|
443
|
+
type_register
|
444
|
+
class << self
|
445
|
+
def init
|
446
|
+
set_template(:resource => "/org/gtk/exampleapp/window.ui")
|
447
|
+
bind_template_child("stack")
|
448
|
+
end
|
449
|
+
end
|
450
|
+
```
|
451
|
+
Most of this piece of code have been seen previously, a window widget interface is defined with a template. But the usage of `bind_template_child("stack")` will add a method, to each ExampleAppWindow instance, which name will be `ExampleAppWindow#stack` and that will return the corresponding child widget in the template.
|
452
|
+
|
453
|
+
The initial implementation of `Gtk::Widget.bind_template_child` have been done in this [pull request](https://github.com/ruby-gnome2/ruby-gnome2/pull/445)
|
454
|
+
|
455
|
+
This new way to access the stack widget is used in the following code. We have previously handled the *open* signal in our application like this:
|
456
|
+
|
457
|
+
```ruby
|
458
|
+
class ExampleAppWindow < Gtk::ApplicationWindow
|
459
|
+
def open(file)
|
460
|
+
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
class ExampleApp < Gtk::Application
|
465
|
+
def initialize
|
466
|
+
# ...
|
467
|
+
|
468
|
+
signal_connect "open" do |application, files, hin|
|
469
|
+
windows = application.windows
|
470
|
+
win = nil
|
471
|
+
unless windows.empty?
|
472
|
+
win = windows.first
|
473
|
+
else
|
474
|
+
win = ExampleAppWindow.new(application)
|
475
|
+
end
|
476
|
+
|
477
|
+
files.each { |file| win.open(file) }
|
478
|
+
|
479
|
+
win.present
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
```
|
484
|
+
|
485
|
+
The `open` method of the main window is called with for each file. Now we manage those files like this:
|
486
|
+
|
487
|
+
```ruby
|
488
|
+
def open(file)
|
489
|
+
basename = file.basename
|
490
|
+
scrolled = Gtk::ScrolledWindow.new
|
491
|
+
scrolled.show
|
492
|
+
scrolled.set_hexpand(true)
|
493
|
+
scrolled.set_vexpand(true)
|
494
|
+
view = Gtk::TextView.new
|
495
|
+
view.set_editable(false)
|
496
|
+
view.set_cursor_visible(false)
|
497
|
+
view.show
|
498
|
+
scrolled.add(view)
|
499
|
+
stack.add_titled(scrolled, basename, basename)
|
500
|
+
stream = file.read
|
501
|
+
view.buffer.text = stream.read
|
502
|
+
end
|
503
|
+
```
|
504
|
+
Each file is opened and loaded in a `Gtk::TextView` with
|
505
|
+
|
506
|
+
```ruby
|
507
|
+
stream = file.read
|
508
|
+
view.buffer.text = stream.read
|
509
|
+
```
|
510
|
+
|
511
|
+
We get the basename, of the file in argument, that will be used as title for each tab of the stack widget:
|
512
|
+
|
513
|
+
```
|
514
|
+
stack.add_titled(scrolled, basename, basename)
|
515
|
+
```
|
516
|
+
|
517
|
+
In this line, given that `self` is `ExampleAppWindow` the usage of `stack` is a call to the method we have created previously. So here we add a tab with a `Gtk::ScrolledWindow` in the `Gtk::Stack` widget of our template and we display the file content.
|
518
|
+
|
519
|
+
|
438
520
|
### An application menu
|
439
521
|
https://developer.gnome.org/gtk3/stable/ch01s04.html#id-1.2.3.12.8
|
440
522
|
|
data/test/gtk-test-utils.rb
CHANGED
@@ -51,6 +51,14 @@ module GtkTestUtils
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
def window_have_default_title?
|
55
|
+
# Maybe 03213b9509fc1df16c66194ea168aed6c15110e9 in GTK+
|
56
|
+
return false if Gtk::Version.or_later?(3, 17, 0)
|
57
|
+
return true if csd_supported?
|
58
|
+
|
59
|
+
false
|
60
|
+
end
|
61
|
+
|
54
62
|
def fixture_path(*components)
|
55
63
|
File.join(File.dirname(__FILE__), "fixture", *components)
|
56
64
|
end
|
@@ -20,7 +20,7 @@ class TestGtkColorChooserDialog < Test::Unit::TestCase
|
|
20
20
|
sub_test_case ".new" do
|
21
21
|
test "no argument" do
|
22
22
|
dialog = Gtk::ColorChooserDialog.new
|
23
|
-
if
|
23
|
+
if window_have_default_title?
|
24
24
|
assert_equal("", dialog.title)
|
25
25
|
else
|
26
26
|
assert_nil(dialog.title)
|
@@ -20,7 +20,7 @@ class TestGtkFontChooserDialog < Test::Unit::TestCase
|
|
20
20
|
sub_test_case ".new" do
|
21
21
|
test "no argument" do
|
22
22
|
dialog = Gtk::FontChooserDialog.new
|
23
|
-
if
|
23
|
+
if window_have_default_title?
|
24
24
|
assert_equal("", dialog.title)
|
25
25
|
else
|
26
26
|
assert_nil(dialog.title)
|
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.4
|
5
5
|
platform: x64-mingw32
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,112 +16,112 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.
|
19
|
+
version: 3.0.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
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.4
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rsvg2
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.0.
|
117
|
+
version: 3.0.4
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.0.
|
124
|
+
version: 3.0.4
|
125
125
|
description: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|
126
126
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
127
127
|
executables: []
|