[cairo-commit] rcairo/gtk/tests .cvsignore, NONE, 1.1 simple.rb, NONE, 1.1 pong.rb, 1.1, 1.2

Evan Martin commit at pdx.freedesktop.org
Fri May 28 12:45:08 PDT 2004


Committed by: martine

Update of /cvs/cairo/rcairo/gtk/tests
In directory pdx:/tmp/cvs-serv30582/gtk/tests

Modified Files:
	pong.rb 
Added Files:
	.cvsignore simple.rb 
Log Message:
changes to allow me to use arch upstream

--- NEW FILE: .cvsignore ---
.arch-ids

--- NEW FILE: simple.rb ---
#!/usr/bin/env ruby
# vim: set ts=2 sw=2 et :

$LOAD_PATH << "../src"

require 'gtk2'

$LOAD_PATH << "../../src"
require 'cairo'

$LOAD_PATH << ".."
require 'gtkcairo'

class DemoWindow < Gtk::Window
	def initialize
    super

    @gc = Gtk::CairoWidget.new

    set_default_size(200, 200)
    signal_connect('destroy') { Gtk.main_quit }
    @gc.signal_connect('redraw') { redraw }

    vb = Gtk::VBox.new(FALSE, 5)
    vb.border_width = 10
    vb.pack_start(@gc, TRUE, TRUE, 0)
    vb.show_all
    add(vb)
  end
  def redraw
    cr = @gc.cairo
    cr.set_rgb_color(0, 0, 0)
    cr.rectangle(0, 0, 100, 100)
    cr.fill

    cr.set_rgb_color(1, 0, 0)
    cr.rectangle(10, 10, 50, 50)
    cr.fill
  end
end

Gtk.init
win = DemoWindow.new
win.show
Gtk.main

Index: pong.rb
===================================================================
RCS file: /cvs/cairo/rcairo/gtk/tests/pong.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/pong.rb	28 May 2004 19:35:32 -0000	1.1
--- b/pong.rb	28 May 2004 19:45:05 -0000	1.2
***************
*** 2,9 ****
  # vim: set ts=2 sw=2 et :
  
- $LOAD_PATH << "../src"
- 
  require 'gtk2'
  require 'cairo'
  require 'gtkcairo'
  
--- 2,11 ----
  # vim: set ts=2 sw=2 et :
  
  require 'gtk2'
+ 
+ $LOAD_PATH << "../../src"
  require 'cairo'
+ 
+ $LOAD_PATH << ".."
  require 'gtkcairo'
  
***************
*** 134,137 ****
--- 136,140 ----
  
      @gc = Gtk::CairoWidget.new
+     @gc.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.new(0,0,0))
      @gc.set_size_request(@field.width, @field.height)
      @gc.signal_connect('redraw') { redraw }





More information about the cairo-commit mailing list