gtk3 3.0.7-x64-mingw32 → 3.0.8-x64-mingw32

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/extconf.rb +1 -0
  3. data/ext/gtk3/rb-gtk3-tree-view.c +4 -0
  4. data/ext/gtk3/rb-gtk3.c +245 -60
  5. data/lib/2.2/gtk3.so +0 -0
  6. data/lib/2.3/gtk3.so +0 -0
  7. data/lib/gtk3/box.rb +22 -0
  8. data/lib/gtk3/builder.rb +50 -29
  9. data/lib/gtk3/deprecated.rb +7 -0
  10. data/lib/gtk3/entry-buffer.rb +28 -0
  11. data/lib/gtk3/list-store.rb +2 -20
  12. data/lib/gtk3/loader.rb +6 -0
  13. data/lib/gtk3/menu-item.rb +8 -7
  14. data/lib/gtk3/tree-iter.rb +25 -1
  15. data/lib/gtk3/tree-model.rb +41 -0
  16. data/lib/gtk3/tree-store.rb +7 -6
  17. data/lib/gtk3/widget.rb +18 -1
  18. data/sample/gtk-demo/TODO +45 -39
  19. data/sample/gtk-demo/assistant.rb +123 -0
  20. data/sample/gtk-demo/builder.rb +75 -38
  21. data/sample/gtk-demo/button_box.rb +100 -0
  22. data/sample/gtk-demo/colorsel.rb +49 -65
  23. data/sample/gtk-demo/css_accordion.rb +33 -55
  24. data/sample/gtk-demo/css_basics.rb +55 -80
  25. data/sample/gtk-demo/css_multiplebgs.rb +112 -0
  26. data/sample/gtk-demo/css_pixbufs.rb +84 -0
  27. data/sample/gtk-demo/css_shadows.rb +101 -0
  28. data/sample/gtk-demo/cursors.rb +114 -0
  29. data/sample/gtk-demo/dialog.rb +105 -115
  30. data/sample/gtk-demo/entry_buffer.rb +44 -0
  31. data/sample/gtk-demo/entry_completion.rb +40 -52
  32. data/sample/gtk-demo/expander.rb +60 -26
  33. data/sample/gtk-demo/filtermodel.rb +119 -0
  34. data/sample/gtk-demo/font_features.rb +117 -0
  35. data/sample/gtk-demo/headerbar.rb +57 -0
  36. data/sample/gtk-demo/iconview_edit.rb +79 -0
  37. data/sample/gtk-demo/infobar.rb +75 -59
  38. data/sample/gtk-demo/links.rb +53 -40
  39. data/sample/gtk-demo/main.rb +353 -43
  40. data/sample/gtk-demo/main.ui +9 -9
  41. data/sample/gtk-demo/markup.rb +46 -0
  42. data/sample/gtk-demo/menus.rb +111 -162
  43. data/sample/gtk-demo/modelbutton.rb +47 -0
  44. data/sample/gtk-demo/overlay.rb +61 -0
  45. data/sample/gtk-demo/overlay2.rb +75 -0
  46. data/sample/gtk-demo/panes.rb +114 -133
  47. data/sample/gtk-demo/pickers.rb +70 -0
  48. data/sample/gtk-demo/popover.rb +110 -0
  49. data/sample/gtk-demo/printing.rb +68 -83
  50. data/sample/gtk-demo/revealer.rb +53 -0
  51. data/sample/gtk-demo/scale.rb +26 -0
  52. data/sample/gtk-demo/search_entry2.rb +107 -0
  53. data/sample/gtk-demo/sidebar.rb +68 -0
  54. data/sample/gtk-demo/sizegroup.rb +93 -105
  55. data/sample/gtk-demo/spinner.rb +53 -50
  56. data/sample/gtk-demo/stack.rb +28 -0
  57. data/sample/gtk-demo/test_mod.rb +22 -0
  58. data/sample/gtk-demo/textmask.rb +61 -0
  59. data/sample/gtk-demo/theming_style_classes.rb +16 -12
  60. data/sample/misc/app-menu.ui +19 -0
  61. data/sample/misc/button-menu.ui +19 -0
  62. data/sample/misc/icons-theme-viewer.rb +65 -0
  63. data/sample/misc/menu.rb +3 -3
  64. data/sample/misc/menus_from_resources.gresource.xml +8 -0
  65. data/sample/misc/menus_from_resources.rb +91 -0
  66. data/sample/misc/statusicon.rb +1 -1
  67. data/sample/misc/toolbar-menu.ui +23 -0
  68. data/sample/misc/treestore.rb +63 -0
  69. data/sample/tutorial/README.md +368 -6
  70. data/test/test-gtk-box.rb +13 -0
  71. data/test/test-gtk-builder.rb +1 -1
  72. data/test/test-gtk-clipboard.rb +124 -0
  73. data/test/test-gtk-container.rb +3 -3
  74. data/test/test-gtk-entry-buffer.rb +32 -0
  75. data/test/test-gtk-list-store.rb +30 -12
  76. data/test/test-gtk-menu.rb +32 -0
  77. data/test/test-gtk-tree-iter.rb +61 -5
  78. data/test/test-gtk-tree-path.rb +26 -1
  79. data/test/test-gtk-tree-sortable.rb +35 -0
  80. data/test/test-gtk-tree-store.rb +34 -0
  81. data/test/test-gtk-widget.rb +33 -2
  82. metadata +57 -22
  83. data/lib/2.0/gtk3.so +0 -0
  84. data/lib/2.1/gtk3.so +0 -0
  85. data/sample/gtk-demo/button-box.rb +0 -82
@@ -18,14 +18,14 @@
18
18
  </menu>
19
19
  <object class="GtkTreeStore" id="treestore">
20
20
  <columns>
21
- <!-- column-name NAME -->
22
- <column type="gchararray"/>
21
+ <!-- column-name NAME
22
+ <column type="gchararray"/> -->
23
23
  <!-- column-name TITLE -->
24
24
  <column type="gchararray"/>
25
25
  <!-- column-name FILENAME -->
26
26
  <column type="gchararray"/>
27
- <!-- column-name FUNC -->
28
- <column type="gpointer"/>
27
+ <!-- column-name FUNC
28
+ <column type="gpointer"/> -->
29
29
  <!-- column-name STYLE -->
30
30
  <column type="gint"/>
31
31
  </columns>
@@ -87,13 +87,13 @@
87
87
  </object>
88
88
  </child>
89
89
  <child>
90
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
90
+ <object class="GtkTreeViewColumn" id="treeviewcolumn0">
91
91
  <property name="title" translatable="yes">column</property>
92
92
  <child>
93
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
93
+ <object class="GtkCellRendererText" id="cellrenderertext0"/>
94
94
  <attributes>
95
- <attribute name="style">4</attribute>
96
- <attribute name="text">1</attribute>
95
+ <attribute name="style">2</attribute>
96
+ <attribute name="text">0</attribute>
97
97
  </attributes>
98
98
  </child>
99
99
  </object>
@@ -112,7 +112,7 @@
112
112
  <property name="enable_popup">1</property>
113
113
  <property name="show_border">0</property>
114
114
  <child>
115
- <object class="GtkScrolledWindow" id="scrolledwindow1">
115
+ <object class="GtkScrolledWindow" id="info-scrolledwindow">
116
116
  <property name="visible">1</property>
117
117
  <property name="can_focus">1</property>
118
118
  <child>
@@ -0,0 +1,46 @@
1
+ # Copyright (c) 2015 Ruby-GNOME2 Project Team
2
+ # This program is licenced under the same licence as Ruby-GNOME2.
3
+ #
4
+ =begin
5
+ = Text View/Markup
6
+
7
+ Gtk::TextBuffer lets you define your own tags that can influence
8
+ text formatting in a variety of ways. In this example, we show
9
+ that Gtk::TextBuffer can load Pango markup and automatically generate
10
+ suitable tags.
11
+
12
+ =end
13
+ module MarkupDemo
14
+
15
+ def self.run_demo(main_window)
16
+ window = Gtk::Window.new(:toplevel)
17
+ window.screen = main_window.screen
18
+ window.set_default_size(450, 450)
19
+
20
+ window.set_title("Markup")
21
+
22
+ view = Gtk::TextView.new
23
+ view.set_wrap_mode(:word)
24
+ view.set_left_margin(10)
25
+ view.set_right_margin(10)
26
+
27
+ sw = Gtk::ScrolledWindow.new(nil, nil)
28
+ sw.set_policy(:never, :automatic)
29
+
30
+ window.add(sw)
31
+ sw.add(view)
32
+
33
+ markup = Gio::Resources.lookup_data("/markup/markup.txt", 0)
34
+
35
+ buffer = view.buffer
36
+ buffer.insert_markup(buffer.start_iter, markup, -1)
37
+
38
+ sw.show_all
39
+
40
+ if !window.visible?
41
+ window.show_all
42
+ else
43
+ window.destroy
44
+ end
45
+ end
46
+ end
@@ -1,172 +1,121 @@
1
- # Copyright (c) 2003-2005 Ruby-GNOME2 Project Team
1
+ # Copyright (c) 2015 Ruby-GNOME2 Project Team
2
2
  # This program is licenced under the same licence as Ruby-GNOME2.
3
3
  #
4
- # $Id: menus.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $
5
4
  =begin
6
- = Menus
7
-
8
- There are several widgets involved in displaying menus. The
9
- Gtk::MenuBar widget is a horizontal menu bar, which normally appears
10
- at the top of an application. The Gtk::Menu widget is the actual menu
11
- that pops up. Both Gtk::MenuBar and Gtk::Menu are subclasses of
12
- Gtk::MenuShell; a Gtk::MenuShell contains menu items
13
- (Gtk::MenuItem). Each menu item contains text and/or images and can
14
- be selected by the user.
15
-
16
- There are several kinds of menu item, including plain Gtk::MenuItem,
17
- Gtk::CheckMenuItem which can be checked/unchecked, Gtk::RadioMenuItem
18
- which is a check menu item that's in a mutually exclusive group,
19
- Gtk::SeparatorMenuItem which is a separator bar, Gtk::TearoffMenuItem
20
- which allows a Gtk::Menu to be torn off, and Gtk::ImageMenuItem which
21
- can place a Gtk::Image or other widget next to the menu text.
22
-
23
- A Gtk::MenuItem can have a submenu, which is simply a Gtk::Menu to pop
24
- up when the menu item is selected. Typically, all menu items in a menu bar
25
- have submenus.
26
-
27
- The Gtk::OptionMenu widget is a button that pops up a Gtk::Menu when clicked.
28
- It's used inside dialogs and such.
29
-
30
- Gtk::ItemFactory provides a higher-level interface for creating menu bars
31
- and menus; while you can construct menus manually, most people don't
32
- do that. There's a separate demo for Gtk::ItemFactory.
5
+ = Menus
6
+
7
+ There are several widgets involved in displaying menus. The
8
+ GtkMenuBar widget is a menu bar, which normally appears horizontally
9
+ at the top of an application, but can also be layed out vertically.
10
+ The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
11
+ and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
12
+ menu items (GtkMenuItem). Each menu item contains text and/or images
13
+ and can be selected by the user.
14
+
15
+ There are several kinds of menu item, including plain GtkMenuItem,
16
+ GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem
17
+ which is a check menu item that's in a mutually exclusive group,
18
+ GtkSeparatorMenuItem which is a separator bar, GtkTearoffMenuItem
19
+ which allows a GtkMenu to be torn off, and GtkImageMenuItem which
20
+ can place a GtkImage or other widget next to the menu text.
21
+
22
+ A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop
23
+ up when the menu item is selected. Typically, all menu items in a menu bar
24
+ have submenus.
33
25
  =end
34
- require 'common'
35
-
36
- module Demo
37
- class Menus < BasicWindow
38
- def initialize
39
- super('menus')
40
- self.border_width = 0
41
-
42
- accel_group = Gtk::AccelGroup.new
43
- add_accel_group(accel_group)
44
-
45
-
46
- box1 = Gtk::VBox.new(false, 0)
47
- add(box1)
48
-
49
- menubar = Gtk::MenuBar.new
50
- box1.pack_start(menubar, :expand => false, :fill => true, :padding => 0)
51
-
52
- menu = create_menu(2, true)
53
-
54
- menuitem = Gtk::MenuItem.new("test\nline2")
55
- menuitem.submenu = menu
56
- menubar.append(menuitem)
57
- menuitem.show
58
-
59
- menuitem = Gtk::MenuItem.new('foo')
60
- menuitem.submenu = create_menu(3, true)
61
- menubar.append(menuitem)
62
- menuitem.show
63
-
64
- menuitem = Gtk::MenuItem.new('bar')
65
- menuitem.submenu = create_menu(4, true)
66
- menuitem.right_justified = true
67
- menubar.append(menuitem)
68
- menuitem.show
69
-
70
- box2 = Gtk::VBox.new(false, 10)
71
- box2.border_width = 10
72
- box1.pack_start(box2, :expand => true, :fill => true, :padding => 0)
73
- box2.show
74
-
75
- menu = create_menu(1, false)
76
- # menu.accel_group = accel_group
77
-
78
- menuitem = Gtk::SeparatorMenuItem.new
79
- menu.append(menuitem)
80
- menuitem.show
81
-
82
- menuitem = Gtk::CheckMenuItem.new('Accelerate Me')
83
- menu.append(menuitem)
84
- menuitem.show
85
- menuitem.add_accelerator('activate',
86
- accel_group,
87
- Gdk::Keyval::KEY_F1,
88
- 0,
89
- Gtk::ACCEL_VISIBLE)
90
- menuitem = Gtk::CheckMenuItem.new('Accelerator Locked')
91
- menu.append(menuitem)
92
- menuitem.show
93
- menuitem.add_accelerator('activate',
94
- accel_group,
95
- Gdk::Keyval::KEY_F2,
96
- 0,
97
- Gtk::ACCEL_VISIBLE | Gtk::ACCEL_LOCKED)
98
- menuitem = Gtk::CheckMenuItem.new('Accelerators Frozen')
99
- menu.append(menuitem)
100
- menuitem.show
101
- menuitem.add_accelerator('activate',
102
- accel_group,
103
- Gdk::Keyval::KEY_F2,
104
- 0,
105
- Gtk::ACCEL_VISIBLE)
106
- menuitem.add_accelerator('activate',
107
- accel_group,
108
- Gdk::Keyval::KEY_F3,
109
- 0,
110
- Gtk::ACCEL_VISIBLE)
111
-
112
- optionmenu = Gtk::OptionMenu.new
113
- optionmenu.menu = menu
114
- optionmenu.history = 3
115
- box2.pack_start(optionmenu, :expand => true, :fill => true, :padding => 0)
116
- optionmenu.show
117
-
118
- separator = Gtk::HSeparator.new
119
- box1.pack_start(separator, :expand => false, :fill => true, :padding => 0)
120
- separator.show
121
-
122
- box2 = Gtk::VBox.new(false, 10)
123
- box2.border_width = 10
124
- box1.pack_start(box2, :expand => false, :fill => true, :padding => 0)
125
- box2.show
126
-
127
- button = Gtk::Button.new('close')
128
- button.signal_connect('clicked') do
129
- quit
26
+ module MenusDemo
27
+ def self.run_demo(main_window)
28
+ window = Gtk::Window.new(:toplevel)
29
+ window.screen = main_window.screen
30
+ window.title = "Menus"
31
+
32
+ accel_group = Gtk::AccelGroup.new
33
+ window.add_accel_group(accel_group)
34
+ window.border_width = 0
35
+
36
+ box = Gtk::Box.new(:horizontal, 0)
37
+ window.add(box)
38
+ box.show
39
+
40
+ box1 = Gtk::Box.new(:horizontal, 0)
41
+ box.add(box1)
42
+ box1.show
43
+
44
+ menubar = Gtk::MenuBar.new
45
+ menubar.expand = true
46
+ box1.pack_start(menubar, :expand => false, :fill => true, :padding => 0)
47
+ menubar.show
48
+
49
+ menu = create_menu(2)
50
+
51
+ menuitem = Gtk::MenuItem.new(:label => "test\nline2")
52
+ menuitem.submenu = menu
53
+ menubar.append(menuitem)
54
+ menuitem.show
55
+
56
+ menuitem = Gtk::MenuItem.new(:label => "foo")
57
+ menuitem.submenu = create_menu(3)
58
+ menubar.append(menuitem)
59
+ menuitem.show
60
+
61
+ menuitem = Gtk::MenuItem.new(:label => "bar")
62
+ menuitem.submenu = create_menu(4)
63
+ menubar.append(menuitem)
64
+ menuitem.show
65
+
66
+ box2 = Gtk::Box.new(:vertical, 10)
67
+ box2.border_width = 10
68
+ box1.pack_start(box2, :expand => false, :fill => true, :padding => 0)
69
+ box2.show
70
+
71
+ button = Gtk::Button.new(:label => "Flip")
72
+ button.signal_connect("clicked") do |_widget|
73
+ parent = menubar.parent
74
+ orientation = parent.orientation.to_i
75
+ parent.orientation = 1 - orientation
76
+
77
+ if orientation == Gtk::Orientation::VERTICAL
78
+ menubar.set_property("pack-direction", Gtk::PackDirection::TTB)
79
+ else
80
+ menubar.set_property("pack-direction", Gtk::PackDirection::LTR)
130
81
  end
131
- box2.pack_start(button, :expand => true, :fill => true, :padding => 0)
132
- button.flags = Gtk::Widget::CAN_DEFAULT
133
- button.grab_default
134
- button.show
135
82
  end
83
+ box2.pack_start(button, :expand => true, :fill => true, :padding => 0)
84
+ button.show
85
+ button = Gtk::Button.new(:label => "Close")
86
+ button.signal_connect("clicked") do |_widget|
87
+ window.destroy
88
+ end
89
+ box2.pack_start(button, :expand => true, :fill => true, :padding => 0)
90
+ button.can_default = true
91
+ button.grab_default
92
+ button.show
93
+
94
+ if !window.visible?
95
+ window.show_all
96
+ else
97
+ window.destroy
98
+ end
99
+ window
100
+ end
136
101
 
137
-
138
- def create_menu (depth, tearoff)
139
- if depth < 1
140
- return nil
141
- end
142
-
143
- menu = Gtk::Menu.new
144
- group = nil
145
-
146
- if tearoff
147
- menuitem = Gtk::TearoffMenuItem.new
148
- menu.append(menuitem)
149
- menuitem.show
150
- end
151
-
152
- 5.times do |i|
153
- buf = sprintf('item %2d - %d', depth, i + 1)
154
- menuitem = Gtk::RadioMenuItem.new(buf)
155
- group = menuitem.group
156
-
157
- menu.append(menuitem)
158
- menuitem.show
159
- if i == 3
160
- menuitem.sensitive = false
161
- end
162
-
163
- if submenu = create_menu(depth - 1, true)
164
- menuitem.submenu = submenu
165
- end
166
- end
167
-
168
- menu.show
169
- return menu
102
+ def self.create_menu(depth)
103
+ return nil if depth < 1
104
+
105
+ menu = Gtk::Menu.new
106
+ last_item = nil
107
+ (0..5).each do |i|
108
+ j = i + 1
109
+ label = "item #{depth} - #{j}"
110
+ menu_item = Gtk::RadioMenuItem.new(nil, label)
111
+ menu_item.join_group(last_item) if last_item
112
+ last_item = menu_item
113
+ menu.append(menu_item)
114
+ menu_item.show
115
+ menu_item.sensitive = false if i == 3
116
+ menu_item.submenu = create_menu(depth - 1)
170
117
  end
118
+
119
+ menu
171
120
  end
172
121
  end
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2008-2015 Ruby-GNOME2 Project Team
2
+ # This program is licenced under the same licence as Ruby-GNOME2.
3
+ #
4
+ =begin
5
+ = Model Button
6
+
7
+ GtkModelButton is a button widget that is designed to be used with
8
+ a GAction as model. The button will adjust its appearance according
9
+ to the kind of action it is connected to.
10
+
11
+ It is also possible to use GtkModelButton without a GAction. In this
12
+ case, you should set the "role" attribute yourself, and connect to the
13
+ "clicked" signal as you would for any other button.
14
+
15
+ A common use of GtkModelButton is to implement menu-like content
16
+ in popovers.
17
+ =end
18
+ module ModelbuttonDemo
19
+ def self.run_demo(main_window)
20
+ builder = Gtk::Builder.new(:resource => "/modelbutton/modelbutton.ui")
21
+
22
+ builder.connect_signals do |name|
23
+ if name == "tool_clicked"
24
+ proc do |button|
25
+ button.active = !button.active?
26
+ end
27
+ end
28
+ end
29
+ window = builder["window1"]
30
+ window.screen = main_window.screen
31
+ actions = Gio::SimpleActionGroup.new
32
+ actions.add_actions([
33
+ { :name => "color", :parameter_type => "s", :state => "'red'" },
34
+ { :name => "chocolate", :state => "true" },
35
+ { :name => "vanilla", :state => "false" },
36
+ { :name => "sprinkles" }
37
+ ])
38
+
39
+ window.insert_action_group("win", actions)
40
+
41
+ if !window.visible?
42
+ window.show_all
43
+ else
44
+ window.destroy
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,61 @@
1
+ # Copyright (c) 2015 Ruby-GNOME2 Project Team
2
+ # This program is licenced under the same licence as Ruby-GNOME2.
3
+ #
4
+ =begin
5
+ = Overlay/Interactive Overlay
6
+
7
+ Shows widgets in static positions over a main widget.
8
+
9
+ The overlayed widgets can be interactive controls such
10
+ as the entry in this example, or just decorative, like
11
+ the big blue label.
12
+ =end
13
+ module OverlayDemo
14
+ def self.run_demo(main_window)
15
+ window = Gtk::Window.new(:toplevel)
16
+ window.set_default_size(500, 510)
17
+ window.set_title("Interactive Overlay")
18
+ window.screen = main_window.screen
19
+
20
+ overlay = Gtk::Overlay.new
21
+ grid = Gtk::Grid.new
22
+ overlay.add(grid)
23
+
24
+ entry = Gtk::Entry.new
25
+
26
+ (0..4).each do |i|
27
+ (0..4).each do |j|
28
+ text = "#{5 * j + i}"
29
+ button = Gtk::Button.new(:label => text)
30
+ button.set_hexpand(true)
31
+ button.set_vexpand(true)
32
+ button.signal_connect "clicked" do |widget|
33
+ entry.text = widget.label
34
+ end
35
+ grid.attach(button, i, j, 1, 1)
36
+ end
37
+ end
38
+
39
+ vbox = Gtk::Box.new(:vertical, 10)
40
+ overlay.add_overlay(vbox)
41
+ overlay.set_overlay_pass_through(vbox, true)
42
+ vbox.set_halign(:center)
43
+ vbox.set_valign(:center)
44
+
45
+ label = Gtk::Label.new("<span foreground='blue' weight='ultrabold' font='40'>Numbers</span>")
46
+ label.set_use_markup(true)
47
+ vbox.pack_start(label, :expand => false, :fill => false, :padding => 8)
48
+
49
+ entry.set_placeholder_text("Your Lucky Number")
50
+ vbox.pack_start(entry, :expand => false, :fill => false, :padding => 8)
51
+
52
+ window.add(overlay)
53
+ overlay.show_all
54
+
55
+ if !window.visible?
56
+ window.show_all
57
+ else
58
+ window.destroy
59
+ end
60
+ end
61
+ end