Generating a drawable widget



Hello,

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);
$vbox->pack_start($graph,1,1,5);

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
Pixmap.
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.

Cheers
Hermann Kaser - a gui newbie



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