class FishbowlDemo

Public Class Methods

new(main_window) click to toggle source
# File gtk3/sample/gtk-demo/fishbowl.rb, line 52
def initialize(main_window)
  builder = Gtk::Builder.new(:resource => "/fishbowl/fishbowl.ui")
  @window = builder["window"]
  @bowl = builder["bowl"]
  @info_label = builder["info_label"]
  @changes_prevent = builder["changes_prevent"]
  @changes_prevent.image = Gtk::Image.new(:icon_name => "changes-prevent")
  @changes_allow = builder["changes_allow"]
  @changes_allow.image = Gtk::Image.new(:icon_name => "changes-allow")
  @window.screen = main_window.screen
  @window.realize
  @bowl.add_tick_callback do
    move_fish
  end
end

Public Instance Methods

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