Generating a drawable widget


I've spent the past few hours trying to figure out how to create a
drawable area, I'm trying to make a little graph area to make a
network usage timeline. I have the following code:

$graph = Gtk2::Gdk::Pixmap->new($drawable,200,100,-1);

my $gc = Gtk2::Gdk::GC->new($graph);
# Draw the graph here using GC

But I haven't managed to generate a drawable area using
Gtk::GDK::Drawable so that it goes in $drawable and therefore fits
The documentation for Gtk::GDK::Pixmap says that ->new accepts either
a Gtk2::Gdk::Drawable or a undef, but it always gives me an error when
trying undef.

Hermann Kaser - a gui newbie

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