gtk4 4.2.9 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/gtk4/rb-gtk4-widget.c +18 -5
- data/lib/gtk4/loader.rb +2 -1
- data/lib/gtk4/popover.rb +29 -0
- data/sample/examples/file_dialog_demo.rb +40 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e445adab7c4bcd0886ee873496d272f57997094a74dc88063c7f994f53a8eb8b
|
4
|
+
data.tar.gz: 7201c4544addc0d79e149ffc91b5c37c4a56414166b82b80a8f33ac6f8778c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac0b21520ad2d1c4e282841a7adea57b39dc9f81fd95595d91a9f811dd83c46b3e8ea0536b774472a9c2c5d15b011846a96f1febc9936d92b405b628019bca2f
|
7
|
+
data.tar.gz: bb691d2ac8a8d673c5ad10c98b60ec4b7d95bb6f5fda6f0b3a871ca1703ffa669add253d8c1566e6cd36a8f6eb1a45cb8a9185efeb9cc22595f5db2af18338f1
|
data/ext/gtk4/rb-gtk4-widget.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2015-
|
3
|
+
* Copyright (C) 2015-2025 Ruby-GNOME Project Team
|
4
4
|
*
|
5
5
|
* This library is free software; you can redistribute it and/or
|
6
6
|
* modify it under the terms of the GNU Lesser General Public
|
@@ -23,10 +23,23 @@
|
|
23
23
|
static void
|
24
24
|
rb_gtk4_widget_mark(gpointer object)
|
25
25
|
{
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
{
|
27
|
+
GtkWidget *child = gtk_widget_get_first_child(object);
|
28
|
+
while (child) {
|
29
|
+
rbgobj_gc_mark_instance(child);
|
30
|
+
child = gtk_widget_get_next_sibling(child);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
{
|
35
|
+
GListModel *controllers = gtk_widget_observe_controllers(object);
|
36
|
+
guint n = g_list_model_get_n_items(controllers);
|
37
|
+
for (guint i = 0; i < n; i++) {
|
38
|
+
GObject *controller = g_list_model_get_object(controllers, i);
|
39
|
+
rbgobj_gc_mark_instance(controller);
|
40
|
+
g_object_unref(controller);
|
41
|
+
}
|
42
|
+
g_object_unref(controllers);
|
30
43
|
}
|
31
44
|
}
|
32
45
|
|
data/lib/gtk4/loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2025 Ruby-GNOME 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
|
@@ -104,6 +104,7 @@ module Gtk
|
|
104
104
|
require_relative "list-store"
|
105
105
|
require_relative "message-dialog"
|
106
106
|
require_relative "paned"
|
107
|
+
require_relative "popover"
|
107
108
|
require_relative "response-type"
|
108
109
|
require_relative "scale-button"
|
109
110
|
require_relative "scrolled-window"
|
data/lib/gtk4/popover.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Copyright (C) 2025 Ruby-GNOME 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 Popover
|
19
|
+
alias_method :pointing_to_raw, :pointing_to
|
20
|
+
def pointing_to
|
21
|
+
have, rectangle = pointing_to_raw
|
22
|
+
if have
|
23
|
+
rectangle
|
24
|
+
else
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (C) 2024 Ruby-GNOME 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
|
+
require "gtk4"
|
18
|
+
|
19
|
+
def on_activate(app)
|
20
|
+
win = Gtk::ApplicationWindow.new(app)
|
21
|
+
dialog = Gtk::FileDialog.new
|
22
|
+
dialog.modal = true
|
23
|
+
dialog.initial_file = Gio::File.open(path: File.expand_path(__FILE__))
|
24
|
+
dialog.initial_folder = Gio::File.open(path: Dir.pwd)
|
25
|
+
dialog.save do |_dialog, result|
|
26
|
+
begin
|
27
|
+
file = dialog.save_finish(result)
|
28
|
+
puts("file.path: #{file.path}")
|
29
|
+
rescue Gtk::DialogError::Dismissed
|
30
|
+
puts("Dismissed")
|
31
|
+
end
|
32
|
+
win.destroy
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
app = Gtk::Application.new("io.github.ruby-gnome.gtk4.example.FileDialog")
|
37
|
+
app.signal_connect("activate") do
|
38
|
+
on_activate(app)
|
39
|
+
end
|
40
|
+
app.run
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: atk
|
@@ -15,28 +15,28 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - '='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 4.
|
18
|
+
version: 4.3.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - '='
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 4.
|
25
|
+
version: 4.3.0
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: gdk4
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - '='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.
|
32
|
+
version: 4.3.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - '='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 4.
|
39
|
+
version: 4.3.0
|
40
40
|
description: Ruby/GTK4 is a Ruby binding of GTK 4.x. It allows Ruby programmers to
|
41
41
|
use the GTK graphics toolkit to make graphical user interfaces for their Ruby scripts.
|
42
42
|
Many of the programs you use like file explorers, browsers, graphics programs etc.
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/gtk4/loader.rb
|
99
99
|
- lib/gtk4/message-dialog.rb
|
100
100
|
- lib/gtk4/paned.rb
|
101
|
+
- lib/gtk4/popover.rb
|
101
102
|
- lib/gtk4/response-type.rb
|
102
103
|
- lib/gtk4/ruby-builder-scope.rb
|
103
104
|
- lib/gtk4/scale-button.rb
|
@@ -175,6 +176,7 @@ files:
|
|
175
176
|
- sample/examples/builder.rb
|
176
177
|
- sample/examples/builder.ui
|
177
178
|
- sample/examples/drawing.rb
|
179
|
+
- sample/examples/file_dialog_demo.rb
|
178
180
|
- sample/examples/grid_packing.rb
|
179
181
|
- sample/examples/hello_world.rb
|
180
182
|
- sample/examples/menubar.rb
|
@@ -203,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
205
|
- !ruby/object:Gem::Version
|
204
206
|
version: '0'
|
205
207
|
requirements: []
|
206
|
-
rubygems_version: 3.6.
|
208
|
+
rubygems_version: 3.6.7
|
207
209
|
specification_version: 4
|
208
210
|
summary: Ruby/GTK4 is a Ruby binding of GTK+-4.x.
|
209
211
|
test_files: []
|