gtkdrawable



HI

I've been looking in the mail archives for posts on 
how to draw lines/arcs on a gtkdrawingarea. The only examples
that seem to work are the ones in which drawing is not done
directly on the drawingarea, but on a pixmap. For example the 
program I pasted below from the mail archive, doesnt work.
Perl reports: 

Usage: Gtk::Gdk::Pixmap::draw_arc(pixmap, gc, filled, x, y, width, 
height, angle1, angle2) at drawingarea2.pl line 18.

The 'chart' exapmle in the distribution does work, but that
uses a pixmap. The problem with that is that it has to be 
redrawn by the program when it receives a _GTK_READ_RCFILES
signals. (Or does this also hold true when drawing directly
on the gtkdrawingarea?) 

jos


 #!/usr/bin/perl -w

use Gtk;
init Gtk;

$win = new Gtk::Window;
$win->set_usize(300,200);
$win->show_all;

$drawing_area = Gtk::DrawingArea->new();
$win->add($drawing_area);
$drawing_area->show;

$drawable = $drawing_area->window;
$gc = $drawing_area->style->black_gc;

 
 $drawable->draw_arc( $drawable, $gc, 1,
                        20, 20, 10, 10,
                        0, 360*60);


main Gtk;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]