class ShortcutsDemo

# Copyright © 2017 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. #

Shortcuts Window

GtkShortcutsWindow is a window that provides a help overlay
for shortcuts and gestures in an application.

Public Class Methods

new(main_window) click to toggle source
# File gtk3/sample/gtk-demo/shortcuts.rb, line 11
def initialize(main_window)
  @icons_added = false
  unless @icons_added
    theme = Gtk::IconTheme.default
    theme.add_resource_path("/icons")
    @icons_added = true
  end

  ui = "/shortcuts/shortcuts.ui"
  @builder = Gtk::Builder.new(:resource => ui)
  builder_add_callback_symbols
  @builder.connect_signals {}

  @window = @builder["window1"]
  @window.screen = main_window.screen
end

Public Instance Methods

run() click to toggle source
# File gtk3/sample/gtk-demo/shortcuts.rb, line 28
def run
  if !@window.visible?
    @window.show_all
  else
    @window.destroy
  end
  @window
end