gtk3 4.2.5 → 4.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/sample/gtk-demo/panes.rb +124 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8decf6179e70ba8e0dd5050e46f69fc69813b8481bbfa453654a6ee620938c
|
4
|
+
data.tar.gz: 8bd3edd7a4c74973ac21e65ffc7974639ca1975717a4767fad20d85d423198dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2a62a6759164359e5099eba8dfc99f7fab803e3d50485dc28cdc28e34ede469e13fb95faa862752e39d9c7aa727b556d112cf9f5bb29814ef3eb138ce21561
|
7
|
+
data.tar.gz: 3c0040cbd320d8faa9955888816b0000e91ab3001d11230d9875215fe916165722c6ba3c9392691606a2e45bf828f739c50aa2e05ff4e82ea3d30a785b9da9b7
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# Copyright (c) 2016 Ruby-GNOME2 Project Team
|
2
|
+
# This program is licenced under the same licence as Ruby-GNOME2.
|
3
|
+
#
|
4
|
+
=begin
|
5
|
+
= Paned Widgets
|
6
|
+
|
7
|
+
The GtkPaned Widget divides its content area into two panes
|
8
|
+
with a divider in between that the user can adjust. A separate
|
9
|
+
child is placed into each pane. GtkPaned widgets can be split
|
10
|
+
horizontally or vertically.
|
11
|
+
|
12
|
+
There are a number of options that can be set for each pane.
|
13
|
+
This test contains both a horizontal and a vertical GtkPaned
|
14
|
+
widget, and allows you to adjust the options for each side of
|
15
|
+
each widget.
|
16
|
+
=end
|
17
|
+
class PanesDemo
|
18
|
+
def initialize(main_window)
|
19
|
+
@window = Gtk::Window.new(:toplevel)
|
20
|
+
@window.screen = main_window.screen
|
21
|
+
@window.title = "Paned Widgets"
|
22
|
+
|
23
|
+
vbox = Gtk::Box.new(:vertical, 0)
|
24
|
+
@window.add(vbox)
|
25
|
+
|
26
|
+
vpaned = Gtk::Paned.new(:vertical)
|
27
|
+
vbox.pack_start(vpaned, :expand => true, :fill => true, :padding => 0)
|
28
|
+
vpaned.margin = 5
|
29
|
+
|
30
|
+
@hpaned = Gtk::Paned.new(:horizontal)
|
31
|
+
vpaned.add1(@hpaned)
|
32
|
+
|
33
|
+
frame = Gtk::Frame.new
|
34
|
+
frame.shadow_type = :in
|
35
|
+
frame.set_size_request(60, 60)
|
36
|
+
@hpaned.add1(frame)
|
37
|
+
|
38
|
+
button = Gtk::Button.new(:label => "_Hi there", :use_underline => true)
|
39
|
+
frame.add(button)
|
40
|
+
|
41
|
+
frame = Gtk::Frame.new
|
42
|
+
frame.shadow_type = :in
|
43
|
+
frame.set_size_request(80, 60)
|
44
|
+
@hpaned.add2(frame)
|
45
|
+
|
46
|
+
frame = Gtk::Frame.new
|
47
|
+
frame.shadow_type = :in
|
48
|
+
frame.set_size_request(60, 80)
|
49
|
+
vpaned.add2(frame)
|
50
|
+
|
51
|
+
# Now create toggle buttons to control sizing
|
52
|
+
buttons = create_pane_options("Horizontal",
|
53
|
+
"Left",
|
54
|
+
"Right")
|
55
|
+
vbox.pack_start(buttons, :expand => false, :fill => false, :padding => 0)
|
56
|
+
buttons = create_pane_options("Vertical",
|
57
|
+
"Top",
|
58
|
+
"Bottom")
|
59
|
+
vbox.pack_start(buttons, :expand => false, :fill => false, :padding => 0)
|
60
|
+
vbox.show_all
|
61
|
+
end
|
62
|
+
|
63
|
+
def run
|
64
|
+
if !@window.visible?
|
65
|
+
@window.show_all
|
66
|
+
else
|
67
|
+
@window.destroy
|
68
|
+
end
|
69
|
+
@window
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def create_pane_options(frame_label, label1, label2)
|
75
|
+
child1 = @hpaned.child1
|
76
|
+
child2 = @hpaned.child2
|
77
|
+
frame = Gtk::Frame.new(frame_label)
|
78
|
+
frame.margin = 4
|
79
|
+
|
80
|
+
@table = Gtk::Grid.new
|
81
|
+
frame.add(@table)
|
82
|
+
|
83
|
+
label = Gtk::Label.new(label1)
|
84
|
+
@table.attach(label, 0, 0, 1, 1)
|
85
|
+
|
86
|
+
check_button(:resize, false, child1, 0, 1)
|
87
|
+
check_button(:shrink, true, child1, 0, 2)
|
88
|
+
|
89
|
+
label = Gtk::Label.new(label2)
|
90
|
+
@table.attach(label, 1, 0, 1, 1)
|
91
|
+
|
92
|
+
check_button(:resize, true, child2, 1, 1)
|
93
|
+
check_button(:shrink, true, child2, 1, 2)
|
94
|
+
frame
|
95
|
+
end
|
96
|
+
|
97
|
+
def check_button(type, active, child, xposition, yposition)
|
98
|
+
is_resize = (type == :resize)
|
99
|
+
label = is_resize ? "_Resize" : "_Shrink"
|
100
|
+
check_button = Gtk::CheckButton.new(label)
|
101
|
+
check_button.use_underline = true
|
102
|
+
check_button.active = active
|
103
|
+
@table.attach(check_button, xposition, yposition, 1, 1)
|
104
|
+
check_button.signal_connect "toggled" do
|
105
|
+
is_child1 = (@hpaned.child1 == child)
|
106
|
+
|
107
|
+
resize = @hpaned.child_get_property(child, "resize")
|
108
|
+
shrink = @hpaned.child_get_property(child, "shrink")
|
109
|
+
|
110
|
+
if is_resize
|
111
|
+
resize = !resize
|
112
|
+
else
|
113
|
+
shrink = !shrink
|
114
|
+
end
|
115
|
+
|
116
|
+
@hpaned.remove(child)
|
117
|
+
if is_child1
|
118
|
+
@hpaned.pack1(child, :resize => resize, :shrink => shrink)
|
119
|
+
else
|
120
|
+
@hpaned.pack2(child, :resize => resize, :shrink => shrink)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.6
|
5
5
|
platform: ruby
|
6
|
-
original_platform: ''
|
7
6
|
authors:
|
8
7
|
- The Ruby-GNOME Project Team
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-25 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: atk
|
@@ -16,28 +15,28 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - '='
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.2.
|
18
|
+
version: 4.2.6
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - '='
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.2.
|
25
|
+
version: 4.2.6
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: gdk3
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.2.
|
32
|
+
version: 4.2.6
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - '='
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.2.
|
39
|
+
version: 4.2.6
|
41
40
|
description: 'Ruby/Gtk3 is a Ruby binding of GTK 3.x. It allows Ruby programmers to
|
42
41
|
use the GTK graphics toolkit to make graphical user interfaces for their Ruby scripts.
|
43
42
|
Many of the programs you use like file explorers, browsers, graphics programs etc.
|
@@ -308,6 +307,7 @@ files:
|
|
308
307
|
- sample/gtk-demo/org.gtk.Demo.gschema.xml
|
309
308
|
- sample/gtk-demo/overlay.rb
|
310
309
|
- sample/gtk-demo/overlay2.rb
|
310
|
+
- sample/gtk-demo/panes.rb
|
311
311
|
- sample/gtk-demo/pickers.rb
|
312
312
|
- sample/gtk-demo/pixbufs.rb
|
313
313
|
- sample/gtk-demo/pointer_cursor.png
|
@@ -619,7 +619,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
619
619
|
- !ruby/object:Gem::Version
|
620
620
|
version: '0'
|
621
621
|
requirements: []
|
622
|
-
rubygems_version: 3.6.
|
622
|
+
rubygems_version: 3.6.2
|
623
623
|
specification_version: 4
|
624
624
|
summary: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|
625
625
|
test_files: []
|