gtk3 3.0.0-x64-mingw32 → 3.0.1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/sample/tutorial/README.md +104 -1
- data/sample/tutorial/exampleapp9/app-menu.ui +18 -0
- data/sample/tutorial/exampleapp9/exampleapp.gresource.xml +9 -0
- data/sample/tutorial/exampleapp9/exampleapp.rb +268 -0
- data/sample/tutorial/exampleapp9/gears-menu.ui +16 -0
- data/sample/tutorial/exampleapp9/org.gtk.exampleapp.gschema.xml +25 -0
- data/sample/tutorial/exampleapp9/prefs.ui +70 -0
- data/sample/tutorial/exampleapp9/window.ui +117 -0
- metadata +23 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03eaa59b321258a61c841449de4b477bf382c5af
|
4
|
+
data.tar.gz: 765d56e51dec6a734cb058a92febe4c105cde725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfd343f2f626297fe127b61bc0118d75889d1de9e8fef982329c951c43febb374f1ed50b943ad4510b459217530d023955b63202a0a3cc6b5db50bae28b934cf
|
7
|
+
data.tar.gz: 89c4823746115c736626345f460603421d336080418e04493de60cd30185463f9ada289dc1c0c6f7589eecc12748c6fec42d66df60b191e0a94f82362cfeceb0
|
data/sample/tutorial/README.md
CHANGED
@@ -312,7 +312,7 @@ In this example we create a subclass of `Gtk::Application` called ExampleApp. In
|
|
312
312
|
* open : opens files and shows them in a new window
|
313
313
|
|
314
314
|
For more informations, see [here](https://wiki.gnome.org/HowDoI/GtkApplication).
|
315
|
-
In this case, the signal "*activate*" will be triggered if no arguments are given to the `ExampleApp#run` method. And a default window will be created and will be presented to the user ( [
|
315
|
+
In this case, the signal "*activate*" will be triggered if no arguments are given to the `ExampleApp#run` method. And a default window will be created and will be presented to the user ( [`Gtk::Widget#present`](https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-present)).
|
316
316
|
|
317
317
|
If file names are given to the `ExampleApp#run` method, then it is the "*open*" signal that is called.
|
318
318
|
Trought this event, you can manage the files that are stored in an array of `Gio::File` objects.
|
@@ -327,6 +327,109 @@ https://developer.gnome.org/gtk3/stable/ch01s04.html#id-1.2.3.12.6
|
|
327
327
|
|
328
328
|
* exampleapp2/exampleapp.rb
|
329
329
|
|
330
|
+
In this step, we use a [`Gtk::Builder`](https://developer.gnome.org/gtk3/stable/GtkBuilder.html) template to associate a [`Gtk::Builder`](https://developer.gnome.org/gtk3/stable/GtkBuilder.html) ui file with our application window class.
|
331
|
+
Our simple ui file puts a [`Gtk::HeaderBar`](https://developer.gnome.org/gtk3/stable/GtkHeaderBar.html) on top of a [`Gtk::Stack`](https://developer.gnome.org/gtk3/stable/GtkStack.html) widget. The header bar contains a [`Gtk::StackSwitcher`](https://developer.gnome.org/gtk3/stable/GtkStackSwitcher.html), which is a standalone widget to show a row of 'tabs' for the pages of a [`Gtk::Stack`](https://developer.gnome.org/gtk3/stable/GtkStack.html) .
|
332
|
+
|
333
|
+
Here is the "window.ui" file that contains the template of the window:
|
334
|
+
|
335
|
+
```xml
|
336
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
337
|
+
<interface>
|
338
|
+
<!-- interface-requires gtk+ 3.8 -->
|
339
|
+
<template class="ExampleAppWindow" parent="GtkApplicationWindow">
|
340
|
+
<property name="title" translatable="yes">Example Application</property>
|
341
|
+
<property name="default-width">600</property>
|
342
|
+
<property name="default-height">400</property>
|
343
|
+
<child>
|
344
|
+
<object class="GtkBox" id="content_box">
|
345
|
+
<property name="visible">True</property>
|
346
|
+
<property name="orientation">vertical</property>
|
347
|
+
<child>
|
348
|
+
<object class="GtkHeaderBar" id="header">
|
349
|
+
<property name="visible">True</property>
|
350
|
+
<child type="title">
|
351
|
+
<object class="GtkStackSwitcher" id="tabs">
|
352
|
+
<property name="visible">True</property>
|
353
|
+
<property name="margin">6</property>
|
354
|
+
<property name="stack">stack</property>
|
355
|
+
</object>
|
356
|
+
</child>
|
357
|
+
</object>
|
358
|
+
</child>
|
359
|
+
<child>
|
360
|
+
<object class="GtkStack" id="stack">
|
361
|
+
<property name="visible">True</property>
|
362
|
+
</object>
|
363
|
+
</child>
|
364
|
+
</object>
|
365
|
+
</child>
|
366
|
+
</template>
|
367
|
+
</interface>
|
368
|
+
```
|
369
|
+
Unlike regular interface descriptions, in template XML descriptions, a`<template>` tag is expected as a direct child of the toplevel `<interface>` tag. Yhe `<template>` tag must specify the "*class*" attribute which must be the class name of the widget. Optionally, the "*parent*" attribute may be specified to indicate the direct parent class (superclass).
|
370
|
+
|
371
|
+
More informations can be found in the part [building composite widgets from template XML](https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget.description) of the `Gtk::Widget` documentation.
|
372
|
+
|
373
|
+
#### Link a template to a custom class widget.
|
374
|
+
|
375
|
+
```ruby
|
376
|
+
class ExampleAppWindow < Gtk::ApplicationWindow
|
377
|
+
type_register
|
378
|
+
class << self
|
379
|
+
def init
|
380
|
+
set_template(:resource => "/org/gtk/exampleapp/window.ui")
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
def initialize(application)
|
385
|
+
super(:application => application)
|
386
|
+
end
|
387
|
+
|
388
|
+
def open(file)
|
389
|
+
|
390
|
+
end
|
391
|
+
end
|
392
|
+
```
|
393
|
+
|
394
|
+
We create a subclass of Gtk::ApplicationWindow. Then we call the method `type_register` inherited from `GLib::Object` in order to register this class as a new [GType](https://developer.gnome.org/gobject/stable/chapter-gtype.html). See the file *ruby-gnome2/glib2/ext/glib2/rbgobj_object.c* for the C implementation. More informations on the gobject manipulation can be found [here](https://blogs.gnome.org/desrt/2012/02/26/a-gentle-introduction-to-gobject-construction/)
|
395
|
+
|
396
|
+
The template of the interface is bound to the class using the `init` singleton method. We just open the *eigenclass* with `class << self` and define the method `init` in which we call the `Gtk::Widget#set_template` method.
|
397
|
+
|
398
|
+
After that, the `ExampleAppWindow#initialize` method must be overwritten. When `type_register` is used, *super* is equivalent to `GLib::Object#initialize` so you need to use properties style constructor (hash argument, see [here](https://github.com/ruby-gnome2/ruby-gnome2/issues/503))
|
399
|
+
|
400
|
+
#### Load a resource file.
|
401
|
+
|
402
|
+
You may have noticed that we used the `:resource => ` key as the argument of the method that sets a template. Now we need to use GLib's resource functionality to include the ui file in the binary. This is commonly done by listing all resources in a .gresource.xml file, such as this:
|
403
|
+
|
404
|
+
```xml
|
405
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
406
|
+
<gresources>
|
407
|
+
<gresource prefix="/org/gtk/exampleapp">
|
408
|
+
<file preprocess="xml-stripblanks">window.ui</file>
|
409
|
+
</gresource>
|
410
|
+
</gresources>
|
411
|
+
```
|
412
|
+
In our script, we built the resource binary file with
|
413
|
+
```ruby
|
414
|
+
system("glib-compile-resources",
|
415
|
+
"--target", gresource_bin,
|
416
|
+
"--sourcedir", File.dirname(gresource_xml),
|
417
|
+
gresource_xml)
|
418
|
+
```
|
419
|
+
Then we make sure that this file is deleted when the script is done :
|
420
|
+
|
421
|
+
```ruby
|
422
|
+
at_exit do
|
423
|
+
FileUtils.rm_f(gresource_bin)
|
424
|
+
end
|
425
|
+
```
|
426
|
+
The resource binary file is loaded so that each resources in it can be accessed via theirs respective paths.
|
427
|
+
|
428
|
+
```ruby
|
429
|
+
resource = Gio::Resource.load(gresource_bin)
|
430
|
+
Gio::Resources.register(resource)
|
431
|
+
```
|
432
|
+
|
330
433
|
### Opening files
|
331
434
|
https://developer.gnome.org/gtk3/stable/ch01s04.html#id-1.2.3.12.7
|
332
435
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.0 -->
|
4
|
+
<menu id="appmenu">
|
5
|
+
<section>
|
6
|
+
<item>
|
7
|
+
<attribute name="label" translatable="yes">_Preferences</attribute>
|
8
|
+
<attribute name="action">app.preferences</attribute>
|
9
|
+
</item>
|
10
|
+
</section>
|
11
|
+
<section>
|
12
|
+
<item>
|
13
|
+
<attribute name="label" translatable="yes">_Quit</attribute>
|
14
|
+
<attribute name="action">app.quit</attribute>
|
15
|
+
</item>
|
16
|
+
</section>
|
17
|
+
</menu>
|
18
|
+
</interface>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<gresources>
|
3
|
+
<gresource prefix="/org/gtk/exampleapp">
|
4
|
+
<file preprocess="xml-stripblanks">window.ui</file>
|
5
|
+
<file preprocess="xml-stripblanks">app-menu.ui</file>
|
6
|
+
<file preprocess="xml-stripblanks">gears-menu.ui</file>
|
7
|
+
<file preprocess="xml-stripblanks">prefs.ui</file>
|
8
|
+
</gresource>
|
9
|
+
</gresources>
|
@@ -0,0 +1,268 @@
|
|
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
|
+
# Original:
|
18
|
+
# * URL: https://git.gnome.org/browse/gtk+/tree/examples/application8/exampleapp.c
|
19
|
+
# * URL: https://git.gnome.org/browse/gtk+/tree/examples/application8/exampleappwin.c
|
20
|
+
# * License: LGPL 2
|
21
|
+
|
22
|
+
require "gtk3"
|
23
|
+
|
24
|
+
require "fileutils"
|
25
|
+
|
26
|
+
current_path = File.expand_path(File.dirname(__FILE__))
|
27
|
+
gresource_bin = "#{current_path}/exampleapp.gresource"
|
28
|
+
gresource_xml = "#{current_path}/exampleapp.gresource.xml"
|
29
|
+
|
30
|
+
system("glib-compile-resources",
|
31
|
+
"--target", gresource_bin,
|
32
|
+
"--sourcedir", current_path,
|
33
|
+
gresource_xml)
|
34
|
+
|
35
|
+
gschema_bin = "#{current_path}/gschemas.compiled"
|
36
|
+
|
37
|
+
system("glib-compile-schemas", current_path)
|
38
|
+
|
39
|
+
at_exit do
|
40
|
+
FileUtils.rm_f([gresource_bin, gschema_bin])
|
41
|
+
end
|
42
|
+
|
43
|
+
resource = Gio::Resource.load(gresource_bin)
|
44
|
+
Gio::Resources.register(resource)
|
45
|
+
|
46
|
+
ENV["GSETTINGS_SCHEMA_DIR"] = current_path
|
47
|
+
|
48
|
+
def update_words(win)
|
49
|
+
tab = win.stack.visible_child
|
50
|
+
return unless tab
|
51
|
+
view = tab.child
|
52
|
+
buffer = view.buffer
|
53
|
+
iter = buffer.start_iter
|
54
|
+
strings = []
|
55
|
+
done = false
|
56
|
+
until iter.end?
|
57
|
+
until iter.starts_word
|
58
|
+
unless iter.forward_char
|
59
|
+
done = true
|
60
|
+
break
|
61
|
+
end
|
62
|
+
end
|
63
|
+
break if done
|
64
|
+
word_end = iter.clone
|
65
|
+
break unless word_end.forward_word_end
|
66
|
+
strings << buffer.get_text(iter, word_end, false)
|
67
|
+
iter = word_end
|
68
|
+
end
|
69
|
+
children = win.words.children
|
70
|
+
children.each { |c| win.words.remove(c) } unless children.empty?
|
71
|
+
strings.each do |s|
|
72
|
+
row = Gtk::Button.new(:label => s)
|
73
|
+
row.signal_connect("clicked") { |_widget| win.searchentry.text = s }
|
74
|
+
row.show
|
75
|
+
win.words.add(row)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def update_lines(win)
|
80
|
+
tab = win.stack.visible_child
|
81
|
+
return unless tab
|
82
|
+
view = tab.child
|
83
|
+
buffer = view.buffer
|
84
|
+
iter = buffer.start_iter
|
85
|
+
count = 0
|
86
|
+
until iter.end?
|
87
|
+
count += 1
|
88
|
+
break unless iter.forward_line
|
89
|
+
end
|
90
|
+
win.lines.text = count.to_s
|
91
|
+
end
|
92
|
+
|
93
|
+
class ExampleAppPrefs < Gtk::Dialog
|
94
|
+
type_register
|
95
|
+
|
96
|
+
class << self
|
97
|
+
def init
|
98
|
+
set_template(:resource => "/org/gtk/exampleapp/prefs.ui")
|
99
|
+
bind_template_child("font")
|
100
|
+
bind_template_child("transition")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def initialize(args)
|
105
|
+
parent = args[:transient_for]
|
106
|
+
super(:transient_for => parent, :use_header_bar => 1)
|
107
|
+
settings = Gio::Settings.new("org.gtk.exampleapp")
|
108
|
+
settings.bind("font",
|
109
|
+
font,
|
110
|
+
"font",
|
111
|
+
Gio::SettingsBindFlags::DEFAULT)
|
112
|
+
settings.bind("transition",
|
113
|
+
transition,
|
114
|
+
"active-id",
|
115
|
+
Gio::SettingsBindFlags::DEFAULT)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
class ExampleAppWindow < Gtk::ApplicationWindow
|
120
|
+
type_register
|
121
|
+
class << self
|
122
|
+
def init
|
123
|
+
set_template(:resource => "/org/gtk/exampleapp/window.ui")
|
124
|
+
bind_template_child("stack")
|
125
|
+
bind_template_child("search")
|
126
|
+
bind_template_child("searchbar")
|
127
|
+
bind_template_child("searchentry")
|
128
|
+
bind_template_child("gears")
|
129
|
+
bind_template_child("words")
|
130
|
+
bind_template_child("sidebar")
|
131
|
+
bind_template_child("lines")
|
132
|
+
bind_template_child("lines_label")
|
133
|
+
|
134
|
+
set_connect_func do |name|
|
135
|
+
method(name)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
|
141
|
+
def search_text_changed(search_entry)
|
142
|
+
text = search_entry.text
|
143
|
+
return if text.empty?
|
144
|
+
|
145
|
+
win = search_entry.toplevel
|
146
|
+
tab = win.stack.visible_child
|
147
|
+
view = tab.child
|
148
|
+
buffer = view.buffer
|
149
|
+
range = buffer.start_iter.forward_search(text,
|
150
|
+
Gtk::TextSearchFlags::CASE_INSENSITIVE)
|
151
|
+
return unless range
|
152
|
+
buffer.select_range(range[0], range[1])
|
153
|
+
view.scroll_to_iter(range[0], 0.0, false, 0.0, 0.0)
|
154
|
+
end
|
155
|
+
|
156
|
+
def visible_child_changed(stack, params)
|
157
|
+
return if stack.in_destruction?
|
158
|
+
win = stack.toplevel
|
159
|
+
win.searchbar.set_search_mode(false)
|
160
|
+
update_words(win)
|
161
|
+
update_lines(win)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def initialize(application)
|
166
|
+
super(:application => application)
|
167
|
+
@settings = Gio::Settings.new("org.gtk.exampleapp")
|
168
|
+
@settings.bind("transition",
|
169
|
+
stack,
|
170
|
+
"transition-type",
|
171
|
+
Gio::SettingsBindFlags::DEFAULT)
|
172
|
+
search.bind_property("active", searchbar, "search-mode-enabled", :bidirectional)
|
173
|
+
@settings.bind("show-words",
|
174
|
+
sidebar,
|
175
|
+
"reveal-child",
|
176
|
+
Gio::SettingsBindFlags::DEFAULT)
|
177
|
+
sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec, _application|
|
178
|
+
update_words(self)
|
179
|
+
end
|
180
|
+
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/gears-menu.ui")
|
181
|
+
menu = builder.get_object("menu")
|
182
|
+
gears.set_menu_model(menu)
|
183
|
+
action = @settings.create_action("show-words")
|
184
|
+
add_action(action)
|
185
|
+
action = Gio::PropertyAction.new("show-lines", lines, "visible")
|
186
|
+
add_action(action)
|
187
|
+
lines.bind_property("visible", lines_label, "visible", :default)
|
188
|
+
end
|
189
|
+
|
190
|
+
def open(file)
|
191
|
+
basename = file.basename
|
192
|
+
|
193
|
+
scrolled = Gtk::ScrolledWindow.new
|
194
|
+
scrolled.show
|
195
|
+
scrolled.set_hexpand(true)
|
196
|
+
scrolled.set_vexpand(true)
|
197
|
+
|
198
|
+
view = Gtk::TextView.new
|
199
|
+
view.set_editable(false)
|
200
|
+
view.set_cursor_visible(false)
|
201
|
+
view.show
|
202
|
+
scrolled.add(view)
|
203
|
+
|
204
|
+
stack.add_titled(scrolled, basename, basename)
|
205
|
+
|
206
|
+
stream = file.read
|
207
|
+
buffer = view.buffer
|
208
|
+
buffer.text = stream.read
|
209
|
+
tag = buffer.create_tag
|
210
|
+
@settings.bind("font", tag, "font", Gio::SettingsBindFlags::DEFAULT)
|
211
|
+
buffer.apply_tag(tag, buffer.start_iter, buffer.end_iter)
|
212
|
+
search.sensitive = true
|
213
|
+
update_words(self)
|
214
|
+
update_lines(self)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
class ExampleApp < Gtk::Application
|
219
|
+
def initialize
|
220
|
+
super("org.gtk.exampleapp", :handles_open)
|
221
|
+
|
222
|
+
signal_connect "startup" do |application|
|
223
|
+
quit_accels = ["<Ctrl>Q"]
|
224
|
+
action = Gio::SimpleAction.new("quit")
|
225
|
+
action.signal_connect("activate") do |_action, _parameter|
|
226
|
+
application.quit
|
227
|
+
end
|
228
|
+
application.add_action(action)
|
229
|
+
application.set_accels_for_action("app.quit", quit_accels)
|
230
|
+
|
231
|
+
action = Gio::SimpleAction.new("preferences")
|
232
|
+
action.signal_connect("activate") do |_action, _parameter|
|
233
|
+
win = application.windows.first
|
234
|
+
prefs = ExampleAppPrefs.new(:transient_for => win,
|
235
|
+
:use_header_bar => true)
|
236
|
+
prefs.present
|
237
|
+
end
|
238
|
+
application.add_action(action)
|
239
|
+
|
240
|
+
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/app-menu.ui")
|
241
|
+
app_menu = builder.get_object("appmenu")
|
242
|
+
application.set_app_menu(app_menu)
|
243
|
+
end
|
244
|
+
|
245
|
+
signal_connect "activate" do |application|
|
246
|
+
window = ExampleAppWindow.new(application)
|
247
|
+
window.present
|
248
|
+
end
|
249
|
+
|
250
|
+
signal_connect "open" do |application, files, _hint|
|
251
|
+
windows = application.windows
|
252
|
+
win = nil
|
253
|
+
if windows.empty?
|
254
|
+
win = ExampleAppWindow.new(application)
|
255
|
+
else
|
256
|
+
win = windows.first
|
257
|
+
end
|
258
|
+
|
259
|
+
files.each { |file| win.open(file) }
|
260
|
+
|
261
|
+
win.present
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
app = ExampleApp.new
|
267
|
+
|
268
|
+
puts app.run([$PROGRAM_NAME] + ARGV)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.0 -->
|
4
|
+
<menu id="menu">
|
5
|
+
<section>
|
6
|
+
<item>
|
7
|
+
<attribute name="label" translatable="yes">_Words</attribute>
|
8
|
+
<attribute name="action">win.show-words</attribute>
|
9
|
+
</item>
|
10
|
+
<item>
|
11
|
+
<attribute name="label" translatable="yes">_Lines</attribute>
|
12
|
+
<attribute name="action">win.show-lines</attribute>
|
13
|
+
</item>
|
14
|
+
</section>
|
15
|
+
</menu>
|
16
|
+
</interface>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<schemalist>
|
3
|
+
<schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
|
4
|
+
<key name="font" type="s">
|
5
|
+
<default>'Monospace 12'</default>
|
6
|
+
<summary>Font</summary>
|
7
|
+
<description>The font to be used for content.</description>
|
8
|
+
</key>
|
9
|
+
<key name="transition" type="s">
|
10
|
+
<choices>
|
11
|
+
<choice value='none'/>
|
12
|
+
<choice value='crossfade'/>
|
13
|
+
<choice value='slide-left-right'/>
|
14
|
+
</choices>
|
15
|
+
<default>'none'</default>
|
16
|
+
<summary>Transition</summary>
|
17
|
+
<description>The transition to use when switching tabs.</description>
|
18
|
+
</key>
|
19
|
+
<key name="show-words" type="b">
|
20
|
+
<default>false</default>
|
21
|
+
<summary>Show words</summary>
|
22
|
+
<description>Whether to show a word list in the sidebar</description>
|
23
|
+
</key>
|
24
|
+
</schema>
|
25
|
+
</schemalist>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.8 -->
|
4
|
+
<template class="ExampleAppPrefs" parent="GtkDialog">
|
5
|
+
<property name="title" translatable="yes">Preferences</property>
|
6
|
+
<property name="resizable">False</property>
|
7
|
+
<property name="modal">True</property>
|
8
|
+
<child internal-child="vbox">
|
9
|
+
<object class="GtkBox" id="vbox">
|
10
|
+
<child>
|
11
|
+
<object class="GtkGrid" id="grid">
|
12
|
+
<property name="visible">True</property>
|
13
|
+
<property name="margin">6</property>
|
14
|
+
<property name="row-spacing">12</property>
|
15
|
+
<property name="column-spacing">6</property>
|
16
|
+
<child>
|
17
|
+
<object class="GtkLabel" id="fontlabel">
|
18
|
+
<property name="visible">True</property>
|
19
|
+
<property name="label">_Font:</property>
|
20
|
+
<property name="use-underline">True</property>
|
21
|
+
<property name="mnemonic-widget">font</property>
|
22
|
+
<property name="xalign">1</property>
|
23
|
+
</object>
|
24
|
+
<packing>
|
25
|
+
<property name="left-attach">0</property>
|
26
|
+
<property name="top-attach">0</property>
|
27
|
+
</packing>
|
28
|
+
</child>
|
29
|
+
<child>
|
30
|
+
<object class="GtkFontButton" id="font">
|
31
|
+
<property name="visible">True</property>
|
32
|
+
</object>
|
33
|
+
<packing>
|
34
|
+
<property name="left-attach">1</property>
|
35
|
+
<property name="top-attach">0</property>
|
36
|
+
</packing>
|
37
|
+
</child>
|
38
|
+
<child>
|
39
|
+
<object class="GtkLabel" id="transitionlabel">
|
40
|
+
<property name="visible">True</property>
|
41
|
+
<property name="label">_Transition:</property>
|
42
|
+
<property name="use-underline">True</property>
|
43
|
+
<property name="mnemonic-widget">transition</property>
|
44
|
+
<property name="xalign">1</property>
|
45
|
+
</object>
|
46
|
+
<packing>
|
47
|
+
<property name="left-attach">0</property>
|
48
|
+
<property name="top-attach">1</property>
|
49
|
+
</packing>
|
50
|
+
</child>
|
51
|
+
<child>
|
52
|
+
<object class="GtkComboBoxText" id="transition">
|
53
|
+
<property name="visible">True</property>
|
54
|
+
<items>
|
55
|
+
<item translatable="yes" id="none">None</item>
|
56
|
+
<item translatable="yes" id="crossfade">Fade</item>
|
57
|
+
<item translatable="yes" id="slide-left-right">Slide</item>
|
58
|
+
</items>
|
59
|
+
</object>
|
60
|
+
<packing>
|
61
|
+
<property name="left-attach">1</property>
|
62
|
+
<property name="top-attach">1</property>
|
63
|
+
</packing>
|
64
|
+
</child>
|
65
|
+
</object>
|
66
|
+
</child>
|
67
|
+
</object>
|
68
|
+
</child>
|
69
|
+
</template>
|
70
|
+
</interface>
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.8 -->
|
4
|
+
<template class="ExampleAppWindow" parent="GtkApplicationWindow">
|
5
|
+
<property name="title" translatable="yes">Example Application</property>
|
6
|
+
<property name="default-width">600</property>
|
7
|
+
<property name="default-height">400</property>
|
8
|
+
<child>
|
9
|
+
<object class="GtkBox" id="content_box">
|
10
|
+
<property name="visible">True</property>
|
11
|
+
<property name="orientation">vertical</property>
|
12
|
+
<child>
|
13
|
+
<object class="GtkHeaderBar" id="header">
|
14
|
+
<property name="visible">True</property>
|
15
|
+
<child>
|
16
|
+
<object class="GtkLabel" id="lines_label">
|
17
|
+
<property name="visible">False</property>
|
18
|
+
<property name="label" translatable="yes">Lines:</property>
|
19
|
+
</object>
|
20
|
+
<packing>
|
21
|
+
<property name="pack-type">start</property>
|
22
|
+
</packing>
|
23
|
+
</child>
|
24
|
+
<child>
|
25
|
+
<object class="GtkLabel" id="lines">
|
26
|
+
<property name="visible">False</property>
|
27
|
+
</object>
|
28
|
+
<packing>
|
29
|
+
<property name="pack-type">start</property>
|
30
|
+
</packing>
|
31
|
+
</child>
|
32
|
+
<child type="title">
|
33
|
+
<object class="GtkStackSwitcher" id="tabs">
|
34
|
+
<property name="visible">True</property>
|
35
|
+
<property name="margin">6</property>
|
36
|
+
<property name="stack">stack</property>
|
37
|
+
</object>
|
38
|
+
</child>
|
39
|
+
<child>
|
40
|
+
<object class="GtkToggleButton" id="search">
|
41
|
+
<property name="visible">True</property>
|
42
|
+
<property name="sensitive">False</property>
|
43
|
+
<style>
|
44
|
+
<class name="image-button"/>
|
45
|
+
</style>
|
46
|
+
<child>
|
47
|
+
<object class="GtkImage" id="search-icon">
|
48
|
+
<property name="visible">True</property>
|
49
|
+
<property name="icon-name">edit-find-symbolic</property>
|
50
|
+
<property name="icon-size">1</property>
|
51
|
+
</object>
|
52
|
+
</child>
|
53
|
+
</object>
|
54
|
+
<packing>
|
55
|
+
<property name="pack-type">end</property>
|
56
|
+
</packing>
|
57
|
+
</child>
|
58
|
+
<child>
|
59
|
+
<object class="GtkMenuButton" id="gears">
|
60
|
+
<property name="visible">True</property>
|
61
|
+
<property name="direction">none</property>
|
62
|
+
<property name="use-popover">True</property>
|
63
|
+
<style>
|
64
|
+
<class name="image-button"/>
|
65
|
+
</style>
|
66
|
+
</object>
|
67
|
+
<packing>
|
68
|
+
<property name="pack-type">end</property>
|
69
|
+
</packing>
|
70
|
+
</child>
|
71
|
+
</object>
|
72
|
+
</child>
|
73
|
+
<child>
|
74
|
+
<object class="GtkSearchBar" id="searchbar">
|
75
|
+
<property name="visible">True</property>
|
76
|
+
<child>
|
77
|
+
<object class="GtkSearchEntry" id="searchentry">
|
78
|
+
<signal name="search-changed" handler="search_text_changed"/>
|
79
|
+
<property name="visible">True</property>
|
80
|
+
</object>
|
81
|
+
</child>
|
82
|
+
</object>
|
83
|
+
</child>
|
84
|
+
<child>
|
85
|
+
<object class="GtkBox" id="hbox">
|
86
|
+
<property name="visible">True</property>
|
87
|
+
<child>
|
88
|
+
<object class="GtkRevealer" id="sidebar">
|
89
|
+
<property name="visible">True</property>
|
90
|
+
<property name="transition-type">slide-right</property>
|
91
|
+
<child>
|
92
|
+
<object class="GtkScrolledWindow" id="sidebar-sw">
|
93
|
+
<property name="visible">True</property>
|
94
|
+
<property name="hscrollbar-policy">never</property>
|
95
|
+
<property name="vscrollbar-policy">automatic</property>
|
96
|
+
<child>
|
97
|
+
<object class="GtkListBox" id="words">
|
98
|
+
<property name="visible">True</property>
|
99
|
+
<property name="selection-mode">none</property>
|
100
|
+
</object>
|
101
|
+
</child>
|
102
|
+
</object>
|
103
|
+
</child>
|
104
|
+
</object>
|
105
|
+
</child>
|
106
|
+
<child>
|
107
|
+
<object class="GtkStack" id="stack">
|
108
|
+
<signal name="notify::visible-child" handler="visible_child_changed"/>
|
109
|
+
<property name="visible">True</property>
|
110
|
+
</object>
|
111
|
+
</child>
|
112
|
+
</object>
|
113
|
+
</child>
|
114
|
+
</object>
|
115
|
+
</child>
|
116
|
+
</template>
|
117
|
+
</interface>
|
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.1
|
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-11 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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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.1
|
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: []
|
@@ -393,6 +393,13 @@ files:
|
|
393
393
|
- sample/tutorial/exampleapp8/org.gtk.exampleapp.gschema.xml
|
394
394
|
- sample/tutorial/exampleapp8/prefs.ui
|
395
395
|
- sample/tutorial/exampleapp8/window.ui
|
396
|
+
- sample/tutorial/exampleapp9/app-menu.ui
|
397
|
+
- sample/tutorial/exampleapp9/exampleapp.gresource.xml
|
398
|
+
- sample/tutorial/exampleapp9/exampleapp.rb
|
399
|
+
- sample/tutorial/exampleapp9/gears-menu.ui
|
400
|
+
- sample/tutorial/exampleapp9/org.gtk.exampleapp.gschema.xml
|
401
|
+
- sample/tutorial/exampleapp9/prefs.ui
|
402
|
+
- sample/tutorial/exampleapp9/window.ui
|
396
403
|
- test/fixture/Rakefile
|
397
404
|
- test/fixture/gnome-logo-icon.png
|
398
405
|
- test/fixture/image.gresource
|