gtk3 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +20 -0
- data/ext/gtk3/conversions.c +34 -0
- data/ext/gtk3/depend +11 -0
- data/ext/gtk3/extconf.rb +99 -0
- data/ext/gtk3/gtk3.def +10 -0
- data/ext/gtk3/init.c +34 -0
- data/ext/gtk3/rbgtk-about-dialog.c +113 -0
- data/ext/gtk3/rbgtk-accel-group-entry.c +94 -0
- data/ext/gtk3/rbgtk-accel-group.c +199 -0
- data/ext/gtk3/rbgtk-accel-key.c +120 -0
- data/ext/gtk3/rbgtk-accel-label.c +55 -0
- data/ext/gtk3/rbgtk-accel-map.c +135 -0
- data/ext/gtk3/rbgtk-accelerator.c +78 -0
- data/ext/gtk3/rbgtk-accessible.c +40 -0
- data/ext/gtk3/rbgtk-action-bar.c +73 -0
- data/ext/gtk3/rbgtk-action-group.c +467 -0
- data/ext/gtk3/rbgtk-action.c +205 -0
- data/ext/gtk3/rbgtk-activatable.c +30 -0
- data/ext/gtk3/rbgtk-adjustment.c +98 -0
- data/ext/gtk3/rbgtk-alignment.c +75 -0
- data/ext/gtk3/rbgtk-allocation.c +166 -0
- data/ext/gtk3/rbgtk-app-chooser-button.c +70 -0
- data/ext/gtk3/rbgtk-app-chooser-dialog.c +68 -0
- data/ext/gtk3/rbgtk-app-chooser-widget.c +40 -0
- data/ext/gtk3/rbgtk-app-chooser.c +47 -0
- data/ext/gtk3/rbgtk-application.c +69 -0
- data/ext/gtk3/rbgtk-arrow.c +56 -0
- data/ext/gtk3/rbgtk-aspect-frame.c +56 -0
- data/ext/gtk3/rbgtk-assistant.c +218 -0
- data/ext/gtk3/rbgtk-bin.c +42 -0
- data/ext/gtk3/rbgtk-binding-set.c +154 -0
- data/ext/gtk3/rbgtk-border.c +119 -0
- data/ext/gtk3/rbgtk-box.c +146 -0
- data/ext/gtk3/rbgtk-buildable.c +96 -0
- data/ext/gtk3/rbgtk-builder.c +166 -0
- data/ext/gtk3/rbgtk-button-box.c +87 -0
- data/ext/gtk3/rbgtk-button.c +93 -0
- data/ext/gtk3/rbgtk-calendar.c +118 -0
- data/ext/gtk3/rbgtk-cell-editable.c +57 -0
- data/ext/gtk3/rbgtk-cell-layout.c +144 -0
- data/ext/gtk3/rbgtk-cell-renderer-accel.c +41 -0
- data/ext/gtk3/rbgtk-cell-renderer-combo.c +38 -0
- data/ext/gtk3/rbgtk-cell-renderer-pixbuf.c +41 -0
- data/ext/gtk3/rbgtk-cell-renderer-progress.c +38 -0
- data/ext/gtk3/rbgtk-cell-renderer-spin.c +39 -0
- data/ext/gtk3/rbgtk-cell-renderer-spinner.c +38 -0
- data/ext/gtk3/rbgtk-cell-renderer-text.c +48 -0
- data/ext/gtk3/rbgtk-cell-renderer-toggle.c +39 -0
- data/ext/gtk3/rbgtk-cell-renderer.c +119 -0
- data/ext/gtk3/rbgtk-cell-view.c +95 -0
- data/ext/gtk3/rbgtk-check-button.c +64 -0
- data/ext/gtk3/rbgtk-check-menu-item.c +64 -0
- data/ext/gtk3/rbgtk-clip-board.c +389 -0
- data/ext/gtk3/rbgtk-color-button.c +55 -0
- data/ext/gtk3/rbgtk-color-selection-dialog.c +56 -0
- data/ext/gtk3/rbgtk-color-selection.c +219 -0
- data/ext/gtk3/rbgtk-combo-box-text.c +138 -0
- data/ext/gtk3/rbgtk-combo-box.c +147 -0
- data/ext/gtk3/rbgtk-const.c +79 -0
- data/ext/gtk3/rbgtk-container.c +788 -0
- data/ext/gtk3/rbgtk-css-provider.c +110 -0
- data/ext/gtk3/rbgtk-dialog.c +206 -0
- data/ext/gtk3/rbgtk-drag-gdk-drag-context.c +108 -0
- data/ext/gtk3/rbgtk-drag.c +93 -0
- data/ext/gtk3/rbgtk-drawing-area.c +42 -0
- data/ext/gtk3/rbgtk-editable.c +149 -0
- data/ext/gtk3/rbgtk-entry-buffer.c +87 -0
- data/ext/gtk3/rbgtk-entry-completion.c +122 -0
- data/ext/gtk3/rbgtk-entry.c +184 -0
- data/ext/gtk3/rbgtk-event-box.c +42 -0
- data/ext/gtk3/rbgtk-expander.c +49 -0
- data/ext/gtk3/rbgtk-file-chooser-button.c +50 -0
- data/ext/gtk3/rbgtk-file-chooser-dialog.c +62 -0
- data/ext/gtk3/rbgtk-file-chooser-widget.c +40 -0
- data/ext/gtk3/rbgtk-file-chooser.c +381 -0
- data/ext/gtk3/rbgtk-file-filter.c +128 -0
- data/ext/gtk3/rbgtk-file-system-error.c +48 -0
- data/ext/gtk3/rbgtk-fixed.c +61 -0
- data/ext/gtk3/rbgtk-font-button.c +49 -0
- data/ext/gtk3/rbgtk-font-chooser-dialog.c +56 -0
- data/ext/gtk3/rbgtk-font-chooser-widget.c +45 -0
- data/ext/gtk3/rbgtk-font-chooser.c +78 -0
- data/ext/gtk3/rbgtk-frame.c +69 -0
- data/ext/gtk3/rbgtk-gdk-event.c +38 -0
- data/ext/gtk3/rbgtk-grid.c +105 -0
- data/ext/gtk3/rbgtk-handle-box.c +45 -0
- data/ext/gtk3/rbgtk-header-bar.c +58 -0
- data/ext/gtk3/rbgtk-hsv.c +102 -0
- data/ext/gtk3/rbgtk-icon-factory.c +85 -0
- data/ext/gtk3/rbgtk-icon-info.c +115 -0
- data/ext/gtk3/rbgtk-icon-set.c +84 -0
- data/ext/gtk3/rbgtk-icon-size.c +91 -0
- data/ext/gtk3/rbgtk-icon-source.c +184 -0
- data/ext/gtk3/rbgtk-icon-theme.c +268 -0
- data/ext/gtk3/rbgtk-icon-view.c +295 -0
- data/ext/gtk3/rbgtk-im-multicontext.c +48 -0
- data/ext/gtk3/rbgtk-image-menu-item.c +67 -0
- data/ext/gtk3/rbgtk-image.c +162 -0
- data/ext/gtk3/rbgtk-imcon-text-simple.c +69 -0
- data/ext/gtk3/rbgtk-imcon-text.c +133 -0
- data/ext/gtk3/rbgtk-infobar.c +121 -0
- data/ext/gtk3/rbgtk-invisible.c +49 -0
- data/ext/gtk3/rbgtk-label.c +139 -0
- data/ext/gtk3/rbgtk-layout.c +93 -0
- data/ext/gtk3/rbgtk-level-bar.c +88 -0
- data/ext/gtk3/rbgtk-link-button.c +49 -0
- data/ext/gtk3/rbgtk-list-store.c +399 -0
- data/ext/gtk3/rbgtk-lock-button.c +50 -0
- data/ext/gtk3/rbgtk-menu-button.c +41 -0
- data/ext/gtk3/rbgtk-menu-item.c +95 -0
- data/ext/gtk3/rbgtk-menu-shell.c +106 -0
- data/ext/gtk3/rbgtk-menu-tool-button.c +81 -0
- data/ext/gtk3/rbgtk-menu.c +168 -0
- data/ext/gtk3/rbgtk-menubar.c +43 -0
- data/ext/gtk3/rbgtk-message-dialog.c +74 -0
- data/ext/gtk3/rbgtk-misc.c +70 -0
- data/ext/gtk3/rbgtk-notebook.c +383 -0
- data/ext/gtk3/rbgtk-numerable-icon.c +50 -0
- data/ext/gtk3/rbgtk-orientable.c +27 -0
- data/ext/gtk3/rbgtk-overlay.c +53 -0
- data/ext/gtk3/rbgtk-page-setup-unix-dialog.c +94 -0
- data/ext/gtk3/rbgtk-page-setup.c +195 -0
- data/ext/gtk3/rbgtk-paned.c +114 -0
- data/ext/gtk3/rbgtk-paper-size.c +179 -0
- data/ext/gtk3/rbgtk-plug.c +85 -0
- data/ext/gtk3/rbgtk-print-context.c +125 -0
- data/ext/gtk3/rbgtk-print-job.c +148 -0
- data/ext/gtk3/rbgtk-print-operation-preview.c +59 -0
- data/ext/gtk3/rbgtk-print-operation.c +149 -0
- data/ext/gtk3/rbgtk-print-settings.c +807 -0
- data/ext/gtk3/rbgtk-print-unix-dialog.c +90 -0
- data/ext/gtk3/rbgtk-printer.c +155 -0
- data/ext/gtk3/rbgtk-progress-bar.c +72 -0
- data/ext/gtk3/rbgtk-radio-action.c +122 -0
- data/ext/gtk3/rbgtk-radio-button.c +89 -0
- data/ext/gtk3/rbgtk-radio-menu-item.c +147 -0
- data/ext/gtk3/rbgtk-radio-tool-button.c +131 -0
- data/ext/gtk3/rbgtk-range.c +68 -0
- data/ext/gtk3/rbgtk-recent-action.c +64 -0
- data/ext/gtk3/rbgtk-recent-chooser-dialog.c +66 -0
- data/ext/gtk3/rbgtk-recent-chooser-menu.c +50 -0
- data/ext/gtk3/rbgtk-recent-chooser-widget.c +48 -0
- data/ext/gtk3/rbgtk-recent-chooser.c +198 -0
- data/ext/gtk3/rbgtk-recent-data.c +188 -0
- data/ext/gtk3/rbgtk-recent-filter-info.c +201 -0
- data/ext/gtk3/rbgtk-recent-filter.c +169 -0
- data/ext/gtk3/rbgtk-recent-info.c +213 -0
- data/ext/gtk3/rbgtk-recent-manager.c +134 -0
- data/ext/gtk3/rbgtk-revealer.c +42 -0
- data/ext/gtk3/rbgtk-scale-button.c +84 -0
- data/ext/gtk3/rbgtk-scale.c +97 -0
- data/ext/gtk3/rbgtk-scrollable.c +31 -0
- data/ext/gtk3/rbgtk-scrollbar.c +52 -0
- data/ext/gtk3/rbgtk-scrolled-window.c +122 -0
- data/ext/gtk3/rbgtk-search-bar.c +59 -0
- data/ext/gtk3/rbgtk-search-entry.c +42 -0
- data/ext/gtk3/rbgtk-selection-data.c +281 -0
- data/ext/gtk3/rbgtk-selection.c +168 -0
- data/ext/gtk3/rbgtk-separator-menu-item.c +39 -0
- data/ext/gtk3/rbgtk-separator-tool-item.c +38 -0
- data/ext/gtk3/rbgtk-separator.c +44 -0
- data/ext/gtk3/rbgtk-settings.c +229 -0
- data/ext/gtk3/rbgtk-size-group.c +66 -0
- data/ext/gtk3/rbgtk-socket.c +82 -0
- data/ext/gtk3/rbgtk-spin-button.c +132 -0
- data/ext/gtk3/rbgtk-spinner.c +55 -0
- data/ext/gtk3/rbgtk-stack-switcher.c +41 -0
- data/ext/gtk3/rbgtk-stack.c +106 -0
- data/ext/gtk3/rbgtk-status-bar.c +77 -0
- data/ext/gtk3/rbgtk-status-icon.c +122 -0
- data/ext/gtk3/rbgtk-stock.c +213 -0
- data/ext/gtk3/rbgtk-style-context-gdk-screen.c +61 -0
- data/ext/gtk3/rbgtk-style-context.c +411 -0
- data/ext/gtk3/rbgtk-style-properties.c +118 -0
- data/ext/gtk3/rbgtk-style-provider.c +67 -0
- data/ext/gtk3/rbgtk-switch.c +40 -0
- data/ext/gtk3/rbgtk-table.c +190 -0
- data/ext/gtk3/rbgtk-target-list.c +125 -0
- data/ext/gtk3/rbgtk-tearoff-menu-item.c +41 -0
- data/ext/gtk3/rbgtk-text-appearance.c +236 -0
- data/ext/gtk3/rbgtk-text-attributes.c +326 -0
- data/ext/gtk3/rbgtk-text-buffer.c +899 -0
- data/ext/gtk3/rbgtk-text-child-anchor.c +56 -0
- data/ext/gtk3/rbgtk-text-iter.c +732 -0
- data/ext/gtk3/rbgtk-text-mark.c +71 -0
- data/ext/gtk3/rbgtk-text-tag-table.c +96 -0
- data/ext/gtk3/rbgtk-text-tag.c +68 -0
- data/ext/gtk3/rbgtk-text-view.c +336 -0
- data/ext/gtk3/rbgtk-theming-engine.c +257 -0
- data/ext/gtk3/rbgtk-toggle-action.c +61 -0
- data/ext/gtk3/rbgtk-toggle-button.c +87 -0
- data/ext/gtk3/rbgtk-toggle-tool-button.c +61 -0
- data/ext/gtk3/rbgtk-tool-button.c +66 -0
- data/ext/gtk3/rbgtk-tool-item.c +200 -0
- data/ext/gtk3/rbgtk-tool-itemgroup.c +70 -0
- data/ext/gtk3/rbgtk-tool-shell.c +96 -0
- data/ext/gtk3/rbgtk-toolbar.c +118 -0
- data/ext/gtk3/rbgtk-tooltip-gdk-display.c +39 -0
- data/ext/gtk3/rbgtk-tooltip.c +100 -0
- data/ext/gtk3/rbgtk-tree-dragdest.c +28 -0
- data/ext/gtk3/rbgtk-tree-dragsource.c +28 -0
- data/ext/gtk3/rbgtk-tree-iter.c +258 -0
- data/ext/gtk3/rbgtk-tree-model.c +246 -0
- data/ext/gtk3/rbgtk-tree-modelfilter.c +197 -0
- data/ext/gtk3/rbgtk-tree-modelsort.c +111 -0
- data/ext/gtk3/rbgtk-tree-path.c +191 -0
- data/ext/gtk3/rbgtk-tree-rowreference.c +140 -0
- data/ext/gtk3/rbgtk-tree-selection.c +190 -0
- data/ext/gtk3/rbgtk-tree-sortable.c +122 -0
- data/ext/gtk3/rbgtk-tree-store.c +330 -0
- data/ext/gtk3/rbgtk-tree-view-column.c +256 -0
- data/ext/gtk3/rbgtk-tree-view.c +716 -0
- data/ext/gtk3/rbgtk-ui-manager.c +189 -0
- data/ext/gtk3/rbgtk-viewport.c +44 -0
- data/ext/gtk3/rbgtk-volume-button.c +41 -0
- data/ext/gtk3/rbgtk-widget-path.c +229 -0
- data/ext/gtk3/rbgtk-widget.c +1554 -0
- data/ext/gtk3/rbgtk-window-group.c +80 -0
- data/ext/gtk3/rbgtk-window.c +565 -0
- data/ext/gtk3/rbgtk.c +783 -0
- data/ext/gtk3/rbgtk3.h +90 -0
- data/ext/gtk3/rbgtk3conversions.h +439 -0
- data/ext/gtk3/rbgtk3private.h +300 -0
- data/ext/gtk3/rbgtk3util.c +67 -0
- data/ext/gtk3/rbgtk3util.h +32 -0
- data/extconf.rb +49 -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/lib/gtk3.rb +11 -0
- data/lib/gtk3/base.rb +67 -0
- data/lib/gtk3/deprecated.rb +1004 -0
- data/sample/gtk-demo/README +7 -0
- data/sample/gtk-demo/alphatest.png +0 -0
- data/sample/gtk-demo/apple-red.png +0 -0
- data/sample/gtk-demo/appwindow.rb +233 -0
- data/sample/gtk-demo/background.jpg +0 -0
- data/sample/gtk-demo/builder.rb +51 -0
- data/sample/gtk-demo/button_box.rb +83 -0
- data/sample/gtk-demo/cairo-arc-negative.rb +41 -0
- data/sample/gtk-demo/cairo-arc.rb +41 -0
- data/sample/gtk-demo/cairo-clip-image.rb +51 -0
- data/sample/gtk-demo/cairo-clip-rectangle.rb +35 -0
- data/sample/gtk-demo/cairo-clip.rb +35 -0
- data/sample/gtk-demo/cairo-curve-rectangle.rb +76 -0
- data/sample/gtk-demo/cairo-curve-to.rb +43 -0
- data/sample/gtk-demo/cairo-dash.rb +39 -0
- data/sample/gtk-demo/cairo-fill-and-stroke.rb +32 -0
- data/sample/gtk-demo/cairo-fill-and-stroke2.rb +38 -0
- data/sample/gtk-demo/cairo-gradient.rb +35 -0
- data/sample/gtk-demo/cairo-image-pattern.rb +39 -0
- data/sample/gtk-demo/cairo-image.rb +49 -0
- data/sample/gtk-demo/cairo-line-cap.rb +53 -0
- data/sample/gtk-demo/cairo-line-join.rb +41 -0
- data/sample/gtk-demo/cairo-long-lines.rb +41 -0
- data/sample/gtk-demo/cairo-operator.rb +83 -0
- data/sample/gtk-demo/cairo-path.rb +28 -0
- data/sample/gtk-demo/cairo-pattern-fill.rb +88 -0
- data/sample/gtk-demo/cairo-self-intersect.rb +32 -0
- data/sample/gtk-demo/cairo-text-align-center.rb +45 -0
- data/sample/gtk-demo/cairo-text-extents.rb +46 -0
- data/sample/gtk-demo/cairo-text.rb +43 -0
- data/sample/gtk-demo/changedisplay.rb +407 -0
- data/sample/gtk-demo/clipboard.rb +67 -0
- data/sample/gtk-demo/colorsel.rb +82 -0
- data/sample/gtk-demo/common.rb +87 -0
- data/sample/gtk-demo/css_accordion.css +53 -0
- data/sample/gtk-demo/css_accordion.rb +75 -0
- data/sample/gtk-demo/demo.ui +258 -0
- data/sample/gtk-demo/dialog.rb +137 -0
- data/sample/gtk-demo/drawingarea.rb +205 -0
- data/sample/gtk-demo/editable_cells.rb +173 -0
- data/sample/gtk-demo/entry_completion.rb +63 -0
- data/sample/gtk-demo/expander.rb +42 -0
- data/sample/gtk-demo/floppybuddy.gif +0 -0
- data/sample/gtk-demo/gnome-applets.png +0 -0
- data/sample/gtk-demo/gnome-calendar.png +0 -0
- data/sample/gtk-demo/gnome-foot.png +0 -0
- data/sample/gtk-demo/gnome-fs-directory.png +0 -0
- data/sample/gtk-demo/gnome-fs-regular.png +0 -0
- data/sample/gtk-demo/gnome-gimp.png +0 -0
- data/sample/gtk-demo/gnome-gmush.png +0 -0
- data/sample/gtk-demo/gnome-gsame.png +0 -0
- data/sample/gtk-demo/gnu-keys.png +0 -0
- data/sample/gtk-demo/gtk-logo-rgb.gif +0 -0
- data/sample/gtk-demo/hypertext.rb +211 -0
- data/sample/gtk-demo/iconview.rb +110 -0
- data/sample/gtk-demo/images.rb +197 -0
- data/sample/gtk-demo/infobar.rb +78 -0
- data/sample/gtk-demo/item_factory.rb +94 -0
- data/sample/gtk-demo/links.rb +53 -0
- data/sample/gtk-demo/list_store.rb +138 -0
- data/sample/gtk-demo/main.rb +384 -0
- data/sample/gtk-demo/menus.rb +172 -0
- data/sample/gtk-demo/panes.rb +156 -0
- data/sample/gtk-demo/pixbufs.rb +167 -0
- data/sample/gtk-demo/printing.rb +128 -0
- data/sample/gtk-demo/reset.css +69 -0
- data/sample/gtk-demo/rotated_text.rb +72 -0
- data/sample/gtk-demo/ruby-gnome2-logo.png +0 -0
- data/sample/gtk-demo/sizegroup.rb +118 -0
- data/sample/gtk-demo/spinner.rb +59 -0
- data/sample/gtk-demo/stock_browser.rb +233 -0
- data/sample/gtk-demo/textview.rb +436 -0
- data/sample/gtk-demo/theming.ui +319 -0
- data/sample/gtk-demo/theming_style_classes.rb +48 -0
- data/sample/gtk-demo/tree_store.rb +270 -0
- data/sample/misc/aboutdialog.rb +42 -0
- data/sample/misc/aboutdialog2.rb +42 -0
- data/sample/misc/alpha-demo.rb +70 -0
- data/sample/misc/assistant.rb +281 -0
- data/sample/misc/bindings.rb +97 -0
- data/sample/misc/button.rb +72 -0
- data/sample/misc/button2.rb +28 -0
- data/sample/misc/buttonbox.rb +93 -0
- data/sample/misc/cairo-pong.rb +217 -0
- data/sample/misc/calendar.rb +66 -0
- data/sample/misc/checkbutton.rb +49 -0
- data/sample/misc/colorselection.rb +22 -0
- data/sample/misc/combo_check.rb +79 -0
- data/sample/misc/combobox.rb +85 -0
- data/sample/misc/composited-windows.rb +113 -0
- data/sample/misc/cursor.rb +34 -0
- data/sample/misc/dialog.rb +44 -0
- data/sample/misc/dialog2.rb +36 -0
- data/sample/misc/dnd.rb +64 -0
- data/sample/misc/dndtreeview.rb +56 -0
- data/sample/misc/drag-move.rb +139 -0
- data/sample/misc/drawing.rb +109 -0
- data/sample/misc/entry.rb +34 -0
- data/sample/misc/entrycompletion.rb +33 -0
- data/sample/misc/expander.rb +27 -0
- data/sample/misc/filechooser.rb +41 -0
- data/sample/misc/frame.rb +69 -0
- data/sample/misc/gdkscreen.rb +32 -0
- data/sample/misc/gnome-logo-icon.png +0 -0
- data/sample/misc/helloworld.rb +35 -0
- data/sample/misc/iconview.rb +38 -0
- data/sample/misc/image.rb +42 -0
- data/sample/misc/itemfactory.rb +73 -0
- data/sample/misc/itemfactory2.rb +74 -0
- data/sample/misc/keyboard_grab.rb +29 -0
- data/sample/misc/label.rb +33 -0
- data/sample/misc/linkbutton.rb +42 -0
- data/sample/misc/listview.rb +92 -0
- data/sample/misc/menu.rb +81 -0
- data/sample/misc/misc_button.rb +49 -0
- data/sample/misc/mouse-gesture.rb +465 -0
- data/sample/misc/pangorenderer.rb +66 -0
- data/sample/misc/pointer_grab.rb +34 -0
- data/sample/misc/print.rb +247 -0
- data/sample/misc/properties.rb +86 -0
- data/sample/misc/radiobutton.rb +47 -0
- data/sample/misc/recentchooserdialog.rb +52 -0
- data/sample/misc/rgtk+cairo.rb +42 -0
- data/sample/misc/scalebutton.rb +19 -0
- data/sample/misc/settings.rb +41 -0
- data/sample/misc/statusicon.rb +106 -0
- data/sample/misc/stock.rb +36 -0
- data/sample/misc/style_property.rb +67 -0
- data/sample/misc/style_property.rc +19 -0
- data/sample/misc/t-gtkplug.rb +58 -0
- data/sample/misc/t-gtksocket.rb +65 -0
- data/sample/misc/test.xpm +92 -0
- data/sample/misc/textbuffer_serialize.rb +130 -0
- data/sample/misc/threads.rb +70 -0
- data/sample/misc/to_drawable.rb +42 -0
- data/sample/misc/togglebutton.rb +34 -0
- data/sample/misc/toolbar.rb +55 -0
- data/sample/misc/tooltips.rb +204 -0
- data/sample/misc/tree_combo.rb +79 -0
- data/sample/misc/tree_progress.rb +61 -0
- data/sample/misc/treemodelfilter.rb +49 -0
- data/sample/misc/treeview.rb +71 -0
- data/sample/misc/uimanager.rb +148 -0
- data/sample/misc/uimanager2.rb +91 -0
- data/sample/misc/uimanager2.xml +36 -0
- data/sample/misc/window.rb +24 -0
- data/sample/misc/xbm_cursor.rb +43 -0
- data/sample/testgtk/3DRings.xpm +116 -0
- data/sample/testgtk/FilesQueue.xpm +98 -0
- data/sample/testgtk/Modeller.xpm +117 -0
- data/sample/testgtk/README +14 -0
- data/sample/testgtk/button.rb +124 -0
- data/sample/testgtk/buttonbox.rb +100 -0
- data/sample/testgtk/check-n.xpm +21 -0
- data/sample/testgtk/check-y.xpm +21 -0
- data/sample/testgtk/checkbutton.rb +67 -0
- data/sample/testgtk/circles.xbm +46 -0
- data/sample/testgtk/colorselect.rb +33 -0
- data/sample/testgtk/dialog.rb +48 -0
- data/sample/testgtk/entry.rb +73 -0
- data/sample/testgtk/filesel.rb +65 -0
- data/sample/testgtk/fontselection.rb +56 -0
- data/sample/testgtk/labels.rb +74 -0
- data/sample/testgtk/layout.rb +108 -0
- data/sample/testgtk/marble.xpm +408 -0
- data/sample/testgtk/menu.rb +79 -0
- data/sample/testgtk/notebook.rb +280 -0
- data/sample/testgtk/pixmap.rb +58 -0
- data/sample/testgtk/progressbar.rb +173 -0
- data/sample/testgtk/radiobutton.rb +61 -0
- data/sample/testgtk/range.rb +65 -0
- data/sample/testgtk/reparent.rb +91 -0
- data/sample/testgtk/sample.rb +80 -0
- data/sample/testgtk/savedposition.rb +87 -0
- data/sample/testgtk/scrolledwindow.rb +67 -0
- data/sample/testgtk/shapedwindow.rb +99 -0
- data/sample/testgtk/spinbutton.rb +181 -0
- data/sample/testgtk/statusbar.rb +89 -0
- data/sample/testgtk/test.xpm +92 -0
- data/sample/testgtk/testgtk.rb +176 -0
- data/sample/testgtk/testgtkrc +146 -0
- data/sample/testgtk/testgtkrc2 +21 -0
- data/sample/testgtk/togglebutton.rb +53 -0
- data/sample/testgtk/toolbar.rb +82 -0
- data/sample/testgtk/tooltips.rb +41 -0
- data/sample/testgtk/wmhints.rb +40 -0
- data/test/gtk-test-utils.rb +15 -0
- data/test/run-test.rb +58 -0
- data/test/test_gc.rb +22 -0
- data/test/test_gtk.rb +23 -0
- data/test/test_gtk_about_dialog.rb +13 -0
- data/test/test_gtk_accel_group_entry.rb +24 -0
- data/test/test_gtk_accel_key.rb +24 -0
- data/test/test_gtk_accessible.rb +31 -0
- data/test/test_gtk_action_group.rb +46 -0
- data/test/test_gtk_allocation.rb +24 -0
- data/test/test_gtk_border.rb +24 -0
- data/test/test_gtk_buildable.rb +56 -0
- data/test/test_gtk_builder.rb +166 -0
- data/test/test_gtk_container.rb +32 -0
- data/test/test_gtk_css_provider.rb +27 -0
- data/test/test_gtk_entry.rb +52 -0
- data/test/test_gtk_header_bar.rb +66 -0
- data/test/test_gtk_icon_theme.rb +31 -0
- data/test/test_gtk_icon_view.rb +41 -0
- data/test/test_gtk_image.rb +8 -0
- data/test/test_gtk_level_bar.rb +82 -0
- data/test/test_gtk_list_store.rb +105 -0
- data/test/test_gtk_menu_button.rb +49 -0
- data/test/test_gtk_menu_item.rb +13 -0
- data/test/test_gtk_recent_data.rb +24 -0
- data/test/test_gtk_recent_filter_info.rb +26 -0
- data/test/test_gtk_revealer.rb +57 -0
- data/test/test_gtk_search_bar.rb +55 -0
- data/test/test_gtk_search_entry.rb +34 -0
- data/test/test_gtk_stack.rb +115 -0
- data/test/test_gtk_stack_switcher.rb +30 -0
- data/test/test_gtk_style_context.rb +30 -0
- data/test/test_gtk_style_properties.rb +38 -0
- data/test/test_gtk_tree_path.rb +20 -0
- data/test/test_gtk_tree_selection.rb +31 -0
- data/test/test_gtk_unix_print.rb +14 -0
- data/test/test_gtk_widget.rb +24 -0
- metadata +582 -0
@@ -0,0 +1,436 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team
|
3
|
+
# This program is licenced under the same licence as Ruby-GNOME2.
|
4
|
+
#
|
5
|
+
# $Id: textview.rb,v 1.8 2005/02/06 18:25:13 kzys Exp $
|
6
|
+
=begin
|
7
|
+
= Text Widget/Multiple Views
|
8
|
+
|
9
|
+
The Gtk::TextView widget displays a Gtk::TextBuffer.
|
10
|
+
One Gtk::TextBuffer can be displayed by multiple Gtk::TextViews.
|
11
|
+
This demo has two views displaying a single buffer,
|
12
|
+
and shows off the widget's text formatting features.
|
13
|
+
=end
|
14
|
+
require 'common'
|
15
|
+
|
16
|
+
module Demo
|
17
|
+
class TextView < BasicWindow
|
18
|
+
|
19
|
+
GRAY50_WIDTH = 2
|
20
|
+
GRAY50_HEIGHT = 2
|
21
|
+
GRAY50_BITS = [0x02, 0x01].pack("c")
|
22
|
+
@@nest_window = nil
|
23
|
+
|
24
|
+
def initialize
|
25
|
+
super("TextView Window")
|
26
|
+
|
27
|
+
set_default_size(450, 450)
|
28
|
+
|
29
|
+
set_title("TextView")
|
30
|
+
set_border_width(0)
|
31
|
+
|
32
|
+
vpaned = Gtk::VPaned.new
|
33
|
+
vpaned.set_border_width(5)
|
34
|
+
add(vpaned)
|
35
|
+
##
|
36
|
+
# For convenience, we just use the autocreated buffer from
|
37
|
+
# the first text view; you could also create the buffer
|
38
|
+
# by itself with Gtk::TextBuffer.new, then later create
|
39
|
+
# a view widget.
|
40
|
+
#
|
41
|
+
view1 = Gtk::TextView.new
|
42
|
+
buffer = view1.buffer
|
43
|
+
view2 = Gtk::TextView.new(buffer)
|
44
|
+
|
45
|
+
sw = Gtk::ScrolledWindow.new(nil, nil)
|
46
|
+
sw.set_policy(:automatic,
|
47
|
+
:automatic)
|
48
|
+
vpaned.add1(sw)
|
49
|
+
|
50
|
+
sw.add(view1)
|
51
|
+
|
52
|
+
sw = Gtk::ScrolledWindow.new(nil, nil)
|
53
|
+
sw.set_policy(:automatic,
|
54
|
+
:automatic)
|
55
|
+
vpaned.add2(sw)
|
56
|
+
|
57
|
+
sw.add(view2)
|
58
|
+
|
59
|
+
create_tags(buffer)
|
60
|
+
insert_text(buffer)
|
61
|
+
|
62
|
+
attach_widgets(view1)
|
63
|
+
attach_widgets(view2)
|
64
|
+
|
65
|
+
vpaned.show_all
|
66
|
+
|
67
|
+
self.show
|
68
|
+
end
|
69
|
+
|
70
|
+
def create_tags(buffer)
|
71
|
+
##
|
72
|
+
# Create a bunch of tags. Note that it's also possible to
|
73
|
+
# create tags with Gtk::TextTag.new then add them to the
|
74
|
+
# tag table for the buffer, Gtk::TextBuffer#create_tag is
|
75
|
+
# just a convenience function. Also note that you don't have
|
76
|
+
# to give tags a name; pass NULL for the name to create an
|
77
|
+
# anonymous tag.
|
78
|
+
#
|
79
|
+
# In any real app, another useful optimization would be to create
|
80
|
+
# a Gtk::TextTagTable in advance, and reuse the same tag table for
|
81
|
+
# all the buffers with the same tag set, instead of creating
|
82
|
+
# new copies of the same tags for every buffer.
|
83
|
+
#
|
84
|
+
# Tags are assigned default priorities in order of addition to the
|
85
|
+
# tag table. That is, tags created later that affect the same text
|
86
|
+
# property affected by an earlier tag will override the earlier
|
87
|
+
# tag. You can modify tag priorities with
|
88
|
+
# Gtk::TextTag#set_priority.
|
89
|
+
#
|
90
|
+
|
91
|
+
buffer.create_tag('heading',
|
92
|
+
'weight' => Pango::FontDescription::WEIGHT_BOLD,
|
93
|
+
'size' => 15 * Pango::SCALE)
|
94
|
+
|
95
|
+
buffer.create_tag("italic",
|
96
|
+
"style" => Pango::FontDescription::STYLE_ITALIC)
|
97
|
+
|
98
|
+
buffer.create_tag("bold",
|
99
|
+
"weight" => Pango::FontDescription::WEIGHT_BOLD)
|
100
|
+
|
101
|
+
buffer.create_tag("big",
|
102
|
+
# points times the PANGO_SCALE factor
|
103
|
+
"size" => 20 * Pango::SCALE)
|
104
|
+
|
105
|
+
buffer.create_tag("xx-small",
|
106
|
+
"scale" => Pango::AttrScale::XX_SMALL)
|
107
|
+
|
108
|
+
buffer.create_tag("x-large",
|
109
|
+
"scale" => Pango::AttrScale::X_LARGE)
|
110
|
+
|
111
|
+
buffer.create_tag("monospace", "family" => "monospace")
|
112
|
+
|
113
|
+
buffer.create_tag("blue_foreground", "foreground" => "blue")
|
114
|
+
|
115
|
+
buffer.create_tag("red_background", "background" => "red")
|
116
|
+
|
117
|
+
stipple = Gdk::Pixmap.create_from_data(nil, GRAY50_BITS, GRAY50_WIDTH,
|
118
|
+
GRAY50_HEIGHT)
|
119
|
+
|
120
|
+
buffer.create_tag("background_stipple",
|
121
|
+
"background_stipple" => stipple)
|
122
|
+
|
123
|
+
buffer.create_tag("foreground_stipple",
|
124
|
+
"foreground_stipple" => stipple)
|
125
|
+
|
126
|
+
buffer.create_tag("big_gap_before_line",
|
127
|
+
"pixels_above_lines" => 30)
|
128
|
+
|
129
|
+
buffer.create_tag("big_gap_after_line",
|
130
|
+
"pixels_below_lines" => 30)
|
131
|
+
|
132
|
+
buffer.create_tag("double_spaced_line",
|
133
|
+
"pixels_inside_wrap" => 10)
|
134
|
+
|
135
|
+
buffer.create_tag("not_editable",
|
136
|
+
"editable" => false)
|
137
|
+
|
138
|
+
buffer.create_tag("word_wrap",
|
139
|
+
"wrap_mode" => :word)
|
140
|
+
|
141
|
+
buffer.create_tag("char_wrap",
|
142
|
+
"wrap_mode" => Gtk::TextTag::WRAP_CHAR)
|
143
|
+
|
144
|
+
buffer.create_tag("no_wrap",
|
145
|
+
"wrap_mode" => :none)
|
146
|
+
|
147
|
+
buffer.create_tag("center",
|
148
|
+
"justification" => Gtk::JUSTIFY_CENTER)
|
149
|
+
|
150
|
+
buffer.create_tag("right_justify",
|
151
|
+
"justification" => Gtk::JUSTIFY_RIGHT)
|
152
|
+
|
153
|
+
buffer.create_tag("wide_margins",
|
154
|
+
"left_margin" => 50,
|
155
|
+
"right_margin" => 50)
|
156
|
+
|
157
|
+
buffer.create_tag("strikethrough",
|
158
|
+
"strikethrough" => true)
|
159
|
+
|
160
|
+
buffer.create_tag("underline",
|
161
|
+
"underline" => Pango::AttrUnderline::SINGLE)
|
162
|
+
|
163
|
+
buffer.create_tag("double_underline",
|
164
|
+
"underline" => Pango::AttrUnderline::DOUBLE)
|
165
|
+
|
166
|
+
buffer.create_tag("superscript",
|
167
|
+
"rise" => 10 * Pango::SCALE, # 10 pixels
|
168
|
+
"size" => 8 * Pango::SCALE) # 8 points
|
169
|
+
|
170
|
+
buffer.create_tag("subscript",
|
171
|
+
"rise" => -10 * Pango::SCALE, # 10 pixels
|
172
|
+
"size" => 8 * Pango::SCALE) # 8 points
|
173
|
+
|
174
|
+
buffer.create_tag("rtl_quote",
|
175
|
+
"wrap_mode" => :word,
|
176
|
+
"direction" => Gtk::Widget::TEXT_DIR_RTL,
|
177
|
+
"indent" => 30,
|
178
|
+
"left_margin" => 20,
|
179
|
+
"right_margin" => 20)
|
180
|
+
end
|
181
|
+
|
182
|
+
def insert_text(buffer)
|
183
|
+
|
184
|
+
##
|
185
|
+
# Demo.find_file looks in the the current directory first,
|
186
|
+
# so you can run gtk-demo without installing GTK, then looks
|
187
|
+
# in the location where the file is installed.
|
188
|
+
#
|
189
|
+
|
190
|
+
filename = Demo.find_file("gtk-logo-rgb.gif")
|
191
|
+
pixbuf = Gdk::Pixbuf.new(filename) if filename
|
192
|
+
|
193
|
+
unless pixbuf
|
194
|
+
$stderr.print "Failed to load image file gtk-logo-rgb.gif\n"
|
195
|
+
exit 1
|
196
|
+
end
|
197
|
+
|
198
|
+
scaled = pixbuf.scale(32, 32, Gdk::Pixbuf::INTERP_BILINEAR)
|
199
|
+
pixbuf = scaled
|
200
|
+
|
201
|
+
##
|
202
|
+
# get start of buffer; each insertion will revalidate the
|
203
|
+
# iterator to point to just after the inserted text.
|
204
|
+
#
|
205
|
+
|
206
|
+
iter = buffer.get_iter_at(:offset => 0)
|
207
|
+
|
208
|
+
buffer.insert(iter, "The text widget can display text with all kinds of nifty attributes. It also supports multiple views of the same buffer; this demo is showing the same buffer in two places.\n\n")
|
209
|
+
|
210
|
+
buffer.insert(iter, "Font styles. ", 'heading')
|
211
|
+
|
212
|
+
buffer.insert(iter, "For example, you can have ")
|
213
|
+
buffer.insert(iter, "italic", "italic")
|
214
|
+
buffer.insert(iter, ", ")
|
215
|
+
buffer.insert(iter, "bold", "bold")
|
216
|
+
buffer.insert(iter, ", or ")
|
217
|
+
buffer.insert(iter, "monospace(typewriter)", "monospace")
|
218
|
+
buffer.insert(iter, ", or ")
|
219
|
+
buffer.insert(iter, "big", "big")
|
220
|
+
buffer.insert(iter, " text. ")
|
221
|
+
buffer.insert(iter, "It's best not to hardcode specific text sizes; you can use relative sizes as with CSS, such as ")
|
222
|
+
buffer.insert(iter, "xx-small", "xx-small")
|
223
|
+
buffer.insert(iter, " or ")
|
224
|
+
buffer.insert(iter, "x-large", "x-large")
|
225
|
+
buffer.insert(iter, " to ensure that your program properly adapts if the user changes the default font size.\n\n")
|
226
|
+
|
227
|
+
buffer.insert(iter, "Colors. ", "heading")
|
228
|
+
|
229
|
+
buffer.insert(iter, "Colors such as ")
|
230
|
+
buffer.insert(iter, "a blue foreground", "blue_foreground")
|
231
|
+
buffer.insert(iter, " or ")
|
232
|
+
buffer.insert(iter, "a red background", "red_background")
|
233
|
+
buffer.insert(iter, " or even ")
|
234
|
+
buffer.insert(iter, "a stippled red background",
|
235
|
+
"red_background", "background_stipple")
|
236
|
+
|
237
|
+
buffer.insert(iter, " or ")
|
238
|
+
buffer.insert(iter, "a stippled blue foreground on solid red background",
|
239
|
+
"blue_foreground", "red_background", "foreground_stipple")
|
240
|
+
|
241
|
+
buffer.insert(iter, "(select that to read it) can be used.\n\n")
|
242
|
+
|
243
|
+
buffer.insert(iter, "Underline, strikethrough, and rise. ", "heading")
|
244
|
+
|
245
|
+
buffer.insert(iter, "Strikethrough", "strikethrough")
|
246
|
+
buffer.insert(iter, ", ")
|
247
|
+
buffer.insert(iter, "underline", "underline")
|
248
|
+
buffer.insert(iter, ", ")
|
249
|
+
buffer.insert(iter, "double underline", "double_underline")
|
250
|
+
buffer.insert(iter, ", ")
|
251
|
+
buffer.insert(iter, "superscript", "superscript")
|
252
|
+
buffer.insert(iter, ", and ")
|
253
|
+
buffer.insert(iter, "subscript", "subscript")
|
254
|
+
buffer.insert(iter, " are all supported.\n\n")
|
255
|
+
|
256
|
+
buffer.insert(iter, "Images. ", "heading")
|
257
|
+
|
258
|
+
buffer.insert(iter, "The buffer can have images in it: ")
|
259
|
+
buffer.insert(iter, pixbuf)
|
260
|
+
buffer.insert(iter, pixbuf)
|
261
|
+
buffer.insert(iter, pixbuf)
|
262
|
+
buffer.insert(iter, " for example.\n\n")
|
263
|
+
|
264
|
+
buffer.insert(iter, "Spacing. ", "heading")
|
265
|
+
|
266
|
+
buffer.insert(iter, "You can adjust the amount of space before each line.\n")
|
267
|
+
|
268
|
+
buffer.insert(iter, "This line has a whole lot of space before it.\n",
|
269
|
+
"big_gap_before_line", "wide_margins")
|
270
|
+
buffer.insert(iter, "You can also adjust the amount of space after each line; this line has a whole lot of space after it.\n",
|
271
|
+
"big_gap_after_line", "wide_margins")
|
272
|
+
|
273
|
+
buffer.insert(iter, "You can also adjust the amount of space between wrapped lines; this line has extra space between each wrapped line in the same paragraph. To show off wrapping, some filler text: the quick brown fox jumped over the lazy dog. Blah blah blah blah blah blah blah blah blah.\n",
|
274
|
+
"double_spaced_line", "wide_margins")
|
275
|
+
|
276
|
+
buffer.insert(iter, "Also note that those lines have extra-wide margins.\n\n")
|
277
|
+
|
278
|
+
buffer.insert(iter, "Editability. ", "heading")
|
279
|
+
|
280
|
+
buffer.insert(iter, "This line is 'locked down' and can't be edited by the user - just try it! You can't delete this line.\n\n",
|
281
|
+
"not_editable")
|
282
|
+
|
283
|
+
buffer.insert(iter, "Wrapping. ", "heading")
|
284
|
+
|
285
|
+
buffer.insert(iter, "This line(and most of the others in this buffer) is word-wrapped, using the proper Unicode algorithm. Word wrap should work in all scripts and languages that GTK+ supports. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n")
|
286
|
+
|
287
|
+
buffer.insert(iter, "This line has character-based wrapping, and can wrap between any two character glyphs. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n", "char_wrap")
|
288
|
+
|
289
|
+
buffer.insert(iter, "This line has all wrapping turned off, so it makes the horizontal scrollbar appear.\n\n\n", "no_wrap")
|
290
|
+
|
291
|
+
buffer.insert(iter, "Justification. ", "heading")
|
292
|
+
|
293
|
+
buffer.insert(iter, "\nThis line has center justification.\n", "center")
|
294
|
+
|
295
|
+
buffer.insert(iter, "This line has right justification.\n",
|
296
|
+
"right_justify")
|
297
|
+
|
298
|
+
buffer.insert(iter, "\nThis line has big wide margins. Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\n", "wide_margins")
|
299
|
+
|
300
|
+
buffer.insert(iter, "Internationalization. ", "heading")
|
301
|
+
|
302
|
+
buffer.insert(iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman(Deutsch Süd) Grüß Gott\nGreek(Ελληνικά) Γειά σας\nHebrew שלום\nJapanese(日本語)\n\nThe widget properly handles bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, grapheme boundaries, and so on using the Pango internationalization framework.\n")
|
303
|
+
|
304
|
+
buffer.insert(iter, "Here's a word-wrapped quote in a right-to-left language:\n")
|
305
|
+
buffer.insert(iter, "??? ??? ???? ?? ???? ???????? ????? ?? ???? ?????? ??????? ??????? ?? ???? ?????? ?? ????? ?? ??????? ????? ??????? ??? ?????? ????? ?????? ????? ???? ?? ?????? ?????? ?? ???????? ?????? ????? ?? ???? ???? ????????? ???????. ???? ???? ??? ???????? ????? ?? »????????« ?? ???????.\n\n", "rtl_quote")
|
306
|
+
|
307
|
+
buffer.insert(iter, "You can put widgets in the buffer: Here's a button: ")
|
308
|
+
anchor = buffer.create_child_anchor(iter)
|
309
|
+
buffer.insert(iter, " and a menu: ")
|
310
|
+
anchor = buffer.create_child_anchor(iter)
|
311
|
+
buffer.insert(iter, " and a scale: ")
|
312
|
+
anchor = buffer.create_child_anchor(iter)
|
313
|
+
buffer.insert(iter, " and an animation: ")
|
314
|
+
anchor = buffer.create_child_anchor(iter)
|
315
|
+
buffer.insert(iter, " finally a text entry: ")
|
316
|
+
anchor = buffer.create_child_anchor(iter)
|
317
|
+
buffer.insert(iter, ".\n")
|
318
|
+
|
319
|
+
buffer.insert(iter, "\n\nThis demo doesn't demonstrate all the Gtk::TextBuffer features; it leaves out, for example: invisible/hidden text(doesn't work in GTK 2, but planned), tab stops, application-drawn areas on the sides of the widget for displaying breakpoints and such...")
|
320
|
+
|
321
|
+
# Apply word_wrap tag to whole buffer
|
322
|
+
|
323
|
+
buf_start, buf_end = buffer.bounds
|
324
|
+
buffer.apply_tag("word_wrap", buf_start, buf_end)
|
325
|
+
end
|
326
|
+
|
327
|
+
def find_anchor(iter)
|
328
|
+
while iter.forward_char do
|
329
|
+
return true if iter.child_anchor
|
330
|
+
end
|
331
|
+
return false
|
332
|
+
end
|
333
|
+
|
334
|
+
def attach_widgets(text_view)
|
335
|
+
|
336
|
+
buffer = text_view.buffer;
|
337
|
+
|
338
|
+
iter = buffer.start_iter
|
339
|
+
|
340
|
+
i = 0;
|
341
|
+
while find_anchor(iter) do
|
342
|
+
anchor = iter.child_anchor
|
343
|
+
|
344
|
+
if i == 0
|
345
|
+
widget = Gtk::Button.new("Click Me")
|
346
|
+
widget.signal_connect('clicked') { |button|
|
347
|
+
if @@nest_window and ! @@nest_window.destroyed?
|
348
|
+
@@nest_window.present
|
349
|
+
break
|
350
|
+
end
|
351
|
+
|
352
|
+
buffer = Gtk::TextBuffer.new
|
353
|
+
iter = buffer.start_iter
|
354
|
+
|
355
|
+
buffer.insert(iter, "This buffer is shared by a set of nested text views.\n Nested view:\n")
|
356
|
+
anchor = buffer.create_child_anchor(iter)
|
357
|
+
buffer.insert(iter, "\nDon't do this in real applications, please.\n")
|
358
|
+
|
359
|
+
view = Gtk::TextView.new(buffer)
|
360
|
+
|
361
|
+
recursive_attach_view(0, view, anchor)
|
362
|
+
|
363
|
+
@@nest_window = Gtk::Window.new(Gtk::Window::TOPLEVEL)
|
364
|
+
sw = Gtk::ScrolledWindow.new(nil, nil)
|
365
|
+
sw.set_policy(:automatic,
|
366
|
+
:automatic)
|
367
|
+
|
368
|
+
@@nest_window.add(sw)
|
369
|
+
sw.add(view)
|
370
|
+
|
371
|
+
@@nest_window.set_default_size(300, 400)
|
372
|
+
@@nest_window.show_all
|
373
|
+
}
|
374
|
+
elsif i == 1
|
375
|
+
menu = Gtk::Menu.new
|
376
|
+
widget = Gtk::OptionMenu.new
|
377
|
+
|
378
|
+
menu_item = Gtk::MenuItem.new("Option 1")
|
379
|
+
menu.append(menu_item)
|
380
|
+
menu_item = Gtk::MenuItem.new("Option 2")
|
381
|
+
menu.append(menu_item)
|
382
|
+
menu_item = Gtk::MenuItem.new("Option 3")
|
383
|
+
menu.append(menu_item)
|
384
|
+
|
385
|
+
widget.menu = menu
|
386
|
+
|
387
|
+
elsif i == 2
|
388
|
+
widget = Gtk::HScale.new
|
389
|
+
widget.set_range(0, 100)
|
390
|
+
widget.set_size_request(70, -1)
|
391
|
+
|
392
|
+
elsif i == 3
|
393
|
+
filename = Demo.find_file("floppybuddy.gif")
|
394
|
+
widget = Gtk::Image.new(filename)
|
395
|
+
|
396
|
+
elsif i == 4
|
397
|
+
widget = Gtk::Entry.new
|
398
|
+
|
399
|
+
else
|
400
|
+
#widget = nil; avoids a compiler warning
|
401
|
+
#g_assert_not_reached ;
|
402
|
+
end
|
403
|
+
|
404
|
+
text_view.add_child_at_anchor(widget,
|
405
|
+
anchor)
|
406
|
+
|
407
|
+
widget.show_all
|
408
|
+
i += 1
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
412
|
+
|
413
|
+
def recursive_attach_view(depth, view, anchor)
|
414
|
+
return if depth > 4
|
415
|
+
|
416
|
+
child_view = Gtk::TextView.new(view.buffer)
|
417
|
+
|
418
|
+
# Event box is to add a black border around each child view
|
419
|
+
event_box = Gtk::EventBox.new
|
420
|
+
color = Gdk::Color.parse("black")
|
421
|
+
event_box.modify_bg(Gtk::STATE_NORMAL, color)
|
422
|
+
|
423
|
+
align = Gtk::Alignment.new(0.5, 0.5, 1.0, 1.0)
|
424
|
+
align.set_border_width(1)
|
425
|
+
|
426
|
+
event_box.add(align)
|
427
|
+
align.add(child_view)
|
428
|
+
|
429
|
+
view.add_child_at_anchor(event_box, anchor)
|
430
|
+
|
431
|
+
recursive_attach_view(depth + 1, child_view, anchor)
|
432
|
+
end
|
433
|
+
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
@@ -0,0 +1,319 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<interface>
|
3
|
+
<object class="GtkGrid" id="grid">
|
4
|
+
<property name="row-spacing">6</property>
|
5
|
+
<property name="orientation">vertical</property>
|
6
|
+
<child>
|
7
|
+
<object class="GtkToolbar" id="toolbar1">
|
8
|
+
<property name="visible">True</property>
|
9
|
+
<property name="can_focus">False</property>
|
10
|
+
<property name="hexpand">True</property>
|
11
|
+
<property name="show-arrow">False</property>
|
12
|
+
<style>
|
13
|
+
<class name="primary-toolbar"/>
|
14
|
+
</style>
|
15
|
+
<child>
|
16
|
+
<object class="GtkToggleToolButton" id="toolbutton1">
|
17
|
+
<property name="use_action_appearance">False</property>
|
18
|
+
<property name="visible">True</property>
|
19
|
+
<property name="can_focus">False</property>
|
20
|
+
<property name="use_action_appearance">False</property>
|
21
|
+
<property name="label" translatable="yes">Normal</property>
|
22
|
+
<property name="use_underline">True</property>
|
23
|
+
<property name="is_important">True</property>
|
24
|
+
<property name="icon_name">edit-find</property>
|
25
|
+
</object>
|
26
|
+
<packing>
|
27
|
+
<property name="expand">False</property>
|
28
|
+
<property name="homogeneous">True</property>
|
29
|
+
</packing>
|
30
|
+
</child>
|
31
|
+
<child>
|
32
|
+
<object class="GtkToggleToolButton" id="toolbutton2">
|
33
|
+
<property name="use_action_appearance">False</property>
|
34
|
+
<property name="visible">True</property>
|
35
|
+
<property name="can_focus">False</property>
|
36
|
+
<property name="use_action_appearance">False</property>
|
37
|
+
<property name="label" translatable="yes">Active</property>
|
38
|
+
<property name="use_underline">True</property>
|
39
|
+
<property name="is_important">True</property>
|
40
|
+
<property name="icon_name">edit-find</property>
|
41
|
+
<property name="active">True</property>
|
42
|
+
</object>
|
43
|
+
<packing>
|
44
|
+
<property name="expand">False</property>
|
45
|
+
<property name="homogeneous">True</property>
|
46
|
+
</packing>
|
47
|
+
</child>
|
48
|
+
<child>
|
49
|
+
<object class="GtkToggleToolButton" id="toolbutton3">
|
50
|
+
<property name="use_action_appearance">False</property>
|
51
|
+
<property name="visible">True</property>
|
52
|
+
<property name="sensitive">False</property>
|
53
|
+
<property name="can_focus">False</property>
|
54
|
+
<property name="label" translatable="yes">Insensitive</property>
|
55
|
+
<property name="use_underline">True</property>
|
56
|
+
<property name="is_important">True</property>
|
57
|
+
<property name="icon_name">edit-find</property>
|
58
|
+
</object>
|
59
|
+
<packing>
|
60
|
+
<property name="expand">False</property>
|
61
|
+
<property name="homogeneous">True</property>
|
62
|
+
</packing>
|
63
|
+
</child>
|
64
|
+
<child>
|
65
|
+
<object class="GtkToggleToolButton" id="toolbutton5">
|
66
|
+
<property name="use_action_appearance">False</property>
|
67
|
+
<property name="visible">True</property>
|
68
|
+
<property name="can_focus">False</property>
|
69
|
+
<property name="label" translatable="yes">Raised</property>
|
70
|
+
<property name="use_underline">True</property>
|
71
|
+
<property name="is_important">True</property>
|
72
|
+
<property name="icon_name">edit-find-symbolic</property>
|
73
|
+
<style>
|
74
|
+
<class name="raised"/>
|
75
|
+
</style>
|
76
|
+
</object>
|
77
|
+
<packing>
|
78
|
+
<property name="expand">False</property>
|
79
|
+
<property name="homogeneous">True</property>
|
80
|
+
</packing>
|
81
|
+
</child>
|
82
|
+
<child>
|
83
|
+
<object class="GtkToggleToolButton" id="toolbutton6">
|
84
|
+
<property name="use_action_appearance">False</property>
|
85
|
+
<property name="visible">True</property>
|
86
|
+
<property name="can_focus">False</property>
|
87
|
+
<property name="label" translatable="yes">Raised Active</property>
|
88
|
+
<property name="use_underline">True</property>
|
89
|
+
<property name="is_important">True</property>
|
90
|
+
<property name="icon_name">edit-find-symbolic</property>
|
91
|
+
<property name="active">True</property>
|
92
|
+
<style>
|
93
|
+
<class name="raised"/>
|
94
|
+
</style>
|
95
|
+
</object>
|
96
|
+
<packing>
|
97
|
+
<property name="expand">False</property>
|
98
|
+
<property name="homogeneous">True</property>
|
99
|
+
</packing>
|
100
|
+
</child>
|
101
|
+
<child>
|
102
|
+
<object class="GtkToggleToolButton" id="toolbutton4">
|
103
|
+
<property name="use_action_appearance">False</property>
|
104
|
+
<property name="visible">True</property>
|
105
|
+
<property name="sensitive">False</property>
|
106
|
+
<property name="can_focus">False</property>
|
107
|
+
<property name="label" translatable="yes">Insensitive Active</property>
|
108
|
+
<property name="use_underline">True</property>
|
109
|
+
<property name="icon_name">edit-find</property>
|
110
|
+
<property name="is_important">True</property>
|
111
|
+
<property name="active">True</property>
|
112
|
+
</object>
|
113
|
+
<packing>
|
114
|
+
<property name="expand">False</property>
|
115
|
+
<property name="homogeneous">True</property>
|
116
|
+
</packing>
|
117
|
+
</child>
|
118
|
+
<child>
|
119
|
+
<object class="GtkToolItem" id="toolitementry">
|
120
|
+
<property name="use_action_appearance">False</property>
|
121
|
+
<property name="visible">True</property>
|
122
|
+
<property name="can_focus">False</property>
|
123
|
+
<child>
|
124
|
+
<object class="GtkEntry" id="entry1">
|
125
|
+
<property name="visible">True</property>
|
126
|
+
<property name="can_focus">True</property>
|
127
|
+
<property name="invisible_char">•</property>
|
128
|
+
<property name="placeholder-text" translatable="yes">Search...</property>
|
129
|
+
<property name="secondary-icon-name">edit-find-symbolic</property>
|
130
|
+
</object>
|
131
|
+
</child>
|
132
|
+
</object>
|
133
|
+
<packing>
|
134
|
+
<property name="expand">False</property>
|
135
|
+
</packing>
|
136
|
+
</child>
|
137
|
+
<child>
|
138
|
+
<object class="GtkToolItem" id="toolitemswitch">
|
139
|
+
<property name="use_action_appearance">False</property>
|
140
|
+
<property name="visible">True</property>
|
141
|
+
<property name="can_focus">False</property>
|
142
|
+
<child>
|
143
|
+
<object class="GtkSwitch" id="switch1">
|
144
|
+
<property name="visible">True</property>
|
145
|
+
<property name="can_focus">True</property>
|
146
|
+
</object>
|
147
|
+
</child>
|
148
|
+
</object>
|
149
|
+
<packing>
|
150
|
+
<property name="expand">False</property>
|
151
|
+
</packing>
|
152
|
+
</child>
|
153
|
+
</object>
|
154
|
+
</child>
|
155
|
+
<child>
|
156
|
+
<object class="GtkBox" id="box1">
|
157
|
+
<property name="visible">True</property>
|
158
|
+
<property name="can_focus">False</property>
|
159
|
+
<property name="orientation">horizontal</property>
|
160
|
+
<property name="valign">center</property>
|
161
|
+
<property name="halign">center</property>
|
162
|
+
<style>
|
163
|
+
<class name="linked"/>
|
164
|
+
</style>
|
165
|
+
<child>
|
166
|
+
<object class="GtkButton" id="button1">
|
167
|
+
<property name="label" translatable="yes">Hi, I am a button</property>
|
168
|
+
<property name="use_action_appearance">False</property>
|
169
|
+
<property name="visible">True</property>
|
170
|
+
<property name="can_focus">True</property>
|
171
|
+
<property name="receives_default">True</property>
|
172
|
+
<property name="use_action_appearance">False</property>
|
173
|
+
</object>
|
174
|
+
<packing>
|
175
|
+
<property name="expand">False</property>
|
176
|
+
<property name="fill">True</property>
|
177
|
+
<property name="position">0</property>
|
178
|
+
</packing>
|
179
|
+
</child>
|
180
|
+
<child>
|
181
|
+
<object class="GtkButton" id="button2">
|
182
|
+
<property name="label" translatable="yes">And I'm another button</property>
|
183
|
+
<property name="use_action_appearance">False</property>
|
184
|
+
<property name="visible">True</property>
|
185
|
+
<property name="can_focus">True</property>
|
186
|
+
<property name="receives_default">True</property>
|
187
|
+
<property name="use_action_appearance">False</property>
|
188
|
+
</object>
|
189
|
+
<packing>
|
190
|
+
<property name="expand">False</property>
|
191
|
+
<property name="fill">True</property>
|
192
|
+
<property name="position">1</property>
|
193
|
+
</packing>
|
194
|
+
</child>
|
195
|
+
<child>
|
196
|
+
<object class="GtkButton" id="button3">
|
197
|
+
<property name="label" translatable="yes">This is a button party!</property>
|
198
|
+
<property name="use_action_appearance">False</property>
|
199
|
+
<property name="visible">True</property>
|
200
|
+
<property name="can_focus">True</property>
|
201
|
+
<property name="receives_default">True</property>
|
202
|
+
<property name="use_action_appearance">False</property>
|
203
|
+
</object>
|
204
|
+
<packing>
|
205
|
+
<property name="expand">False</property>
|
206
|
+
<property name="fill">True</property>
|
207
|
+
<property name="position">2</property>
|
208
|
+
</packing>
|
209
|
+
</child>
|
210
|
+
</object>
|
211
|
+
</child>
|
212
|
+
<child>
|
213
|
+
<object class="GtkToolbar" id="itoolbar1">
|
214
|
+
<property name="visible">True</property>
|
215
|
+
<property name="can_focus">False</property>
|
216
|
+
<property name="hexpand">True</property>
|
217
|
+
<property name="icon_size">1</property>
|
218
|
+
<style>
|
219
|
+
<class name="inline-toolbar"/>
|
220
|
+
</style>
|
221
|
+
<child>
|
222
|
+
<object class="GtkToggleToolButton" id="itoolbutton1">
|
223
|
+
<property name="use_action_appearance">False</property>
|
224
|
+
<property name="visible">True</property>
|
225
|
+
<property name="can_focus">False</property>
|
226
|
+
<property name="use_action_appearance">False</property>
|
227
|
+
<property name="label" translatable="yes">Normal</property>
|
228
|
+
<property name="use_underline">True</property>
|
229
|
+
<property name="icon_name">list-add-symbolic</property>
|
230
|
+
</object>
|
231
|
+
<packing>
|
232
|
+
<property name="expand">False</property>
|
233
|
+
<property name="homogeneous">True</property>
|
234
|
+
</packing>
|
235
|
+
</child>
|
236
|
+
<child>
|
237
|
+
<object class="GtkToggleToolButton" id="itoolbutton2">
|
238
|
+
<property name="use_action_appearance">False</property>
|
239
|
+
<property name="visible">True</property>
|
240
|
+
<property name="can_focus">False</property>
|
241
|
+
<property name="use_action_appearance">False</property>
|
242
|
+
<property name="label" translatable="yes">Normal</property>
|
243
|
+
<property name="use_underline">True</property>
|
244
|
+
<property name="icon_name">list-add-symbolic</property>
|
245
|
+
</object>
|
246
|
+
<packing>
|
247
|
+
<property name="expand">False</property>
|
248
|
+
<property name="homogeneous">True</property>
|
249
|
+
</packing>
|
250
|
+
</child>
|
251
|
+
<child>
|
252
|
+
<object class="GtkToggleToolButton" id="itoolbutton3">
|
253
|
+
<property name="use_action_appearance">False</property>
|
254
|
+
<property name="visible">True</property>
|
255
|
+
<property name="can_focus">False</property>
|
256
|
+
<property name="use_action_appearance">False</property>
|
257
|
+
<property name="label" translatable="yes">Active</property>
|
258
|
+
<property name="use_underline">True</property>
|
259
|
+
<property name="icon_name">list-remove-symbolic</property>
|
260
|
+
<property name="active">True</property>
|
261
|
+
</object>
|
262
|
+
<packing>
|
263
|
+
<property name="expand">False</property>
|
264
|
+
<property name="homogeneous">True</property>
|
265
|
+
</packing>
|
266
|
+
</child>
|
267
|
+
<child>
|
268
|
+
<object class="GtkToggleToolButton" id="itoolbutton4">
|
269
|
+
<property name="use_action_appearance">False</property>
|
270
|
+
<property name="visible">True</property>
|
271
|
+
<property name="can_focus">False</property>
|
272
|
+
<property name="use_action_appearance">False</property>
|
273
|
+
<property name="label" translatable="yes">Active</property>
|
274
|
+
<property name="use_underline">True</property>
|
275
|
+
<property name="icon_name">list-remove-symbolic</property>
|
276
|
+
<property name="active">True</property>
|
277
|
+
</object>
|
278
|
+
<packing>
|
279
|
+
<property name="expand">False</property>
|
280
|
+
<property name="homogeneous">True</property>
|
281
|
+
</packing>
|
282
|
+
</child>
|
283
|
+
<child>
|
284
|
+
<object class="GtkToggleToolButton" id="itoolbutton5">
|
285
|
+
<property name="use_action_appearance">False</property>
|
286
|
+
<property name="visible">True</property>
|
287
|
+
<property name="sensitive">False</property>
|
288
|
+
<property name="can_focus">False</property>
|
289
|
+
<property name="use_action_appearance">False</property>
|
290
|
+
<property name="label" translatable="yes">Insensitive</property>
|
291
|
+
<property name="use_underline">True</property>
|
292
|
+
<property name="icon_name">edit-find-symbolic</property>
|
293
|
+
</object>
|
294
|
+
<packing>
|
295
|
+
<property name="expand">False</property>
|
296
|
+
<property name="homogeneous">True</property>
|
297
|
+
</packing>
|
298
|
+
</child>
|
299
|
+
<child>
|
300
|
+
<object class="GtkToggleToolButton" id="itoolbutton6">
|
301
|
+
<property name="use_action_appearance">False</property>
|
302
|
+
<property name="visible">True</property>
|
303
|
+
<property name="sensitive">False</property>
|
304
|
+
<property name="can_focus">False</property>
|
305
|
+
<property name="use_action_appearance">False</property>
|
306
|
+
<property name="label" translatable="yes">Insensitive Active</property>
|
307
|
+
<property name="use_underline">True</property>
|
308
|
+
<property name="icon_name">go-up-symbolic</property>
|
309
|
+
<property name="active">True</property>
|
310
|
+
</object>
|
311
|
+
<packing>
|
312
|
+
<property name="expand">False</property>
|
313
|
+
<property name="homogeneous">True</property>
|
314
|
+
</packing>
|
315
|
+
</child>
|
316
|
+
</object>
|
317
|
+
</child>
|
318
|
+
</object>
|
319
|
+
</interface>
|