Sha256: 726a0e10d6c108ce51abb0dc460cdd807aca21013e3889deacfa883b0590c7cc

Contents?: true

Size: 1021 Bytes

Versions: 184

Compression:

Stored size: 1021 Bytes

Contents

=begin header

  rulers.rb - a part of testgtk.c rewritten in Ruby/GTK2

  Copyright (C) 2002-2005 Ruby-GNOME2 Project Team

  $Id: rulers.rb,v 1.9 2005/07/18 17:13:33 mutoh Exp $

=end

require 'sample'

class RulerSample < SampleWindow
  def initialize
    super("rulers")

    set_default_size(300, 300)

    set_events(Gdk::Event::POINTER_MOTION_MASK | 
	       Gdk::Event::POINTER_MOTION_HINT_MASK)

    table = Gtk::Table.new(2, 2, false)
    add(table)

    hruler = Gtk::HRuler.new
    hruler.metric = Gtk::CENTIMETERS
    hruler.set_range(100, 0, 0, 20)

    vruler = Gtk::VRuler.new
    vruler.set_range(5, 15, 0, 20)

    signal_connect("motion_notify_event"){ |w, e|
      vruler.signal_emit("motion_notify_event", e)
    }

    table.attach(hruler, 1, 2, 0, 1,
		 Gtk::EXPAND | Gtk::FILL, Gtk::FILL, 0, 0)

    signal_connect("motion_notify_event"){ |w, e|
       hruler.signal_emit("motion_notify_event", e)
    }

    table.attach(vruler, 0, 1, 1, 2,
		 Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0)
  end
end

Version data entries

184 entries across 184 versions & 1 rubygems

Version Path
gtk2-3.4.3 sample/testgtk/rulers.rb
gtk2-3.4.2 sample/testgtk/rulers.rb
gtk2-3.4.1 sample/testgtk/rulers.rb
gtk2-3.4.0 sample/testgtk/rulers.rb
gtk2-3.3.9 sample/testgtk/rulers.rb
gtk2-3.3.8 sample/testgtk/rulers.rb
gtk2-3.3.7 sample/testgtk/rulers.rb
gtk2-3.3.6 sample/testgtk/rulers.rb
gtk2-3.3.5 sample/testgtk/rulers.rb
gtk2-3.3.4 sample/testgtk/rulers.rb
gtk2-3.3.3 sample/testgtk/rulers.rb
gtk2-3.3.2 sample/testgtk/rulers.rb
gtk2-3.3.1 sample/testgtk/rulers.rb
gtk2-3.3.0 sample/testgtk/rulers.rb
gtk2-3.2.9-x64-mingw32 sample/testgtk/rulers.rb
gtk2-3.2.9-x86-mingw32 sample/testgtk/rulers.rb
gtk2-3.2.9 sample/testgtk/rulers.rb
gtk2-3.2.8-x64-mingw32 sample/testgtk/rulers.rb
gtk2-3.2.8-x86-mingw32 sample/testgtk/rulers.rb
gtk2-3.2.8 sample/testgtk/rulers.rb