Example for doing gtk draw_string on a drawing area (newbie)



Hi, I'm new to Perl, and to GTK programming.

I'm making an SNMP graphing application, and have so far got it to poll,
draw, and update the display.

Now I need to draw some labels and values on the axes.

I'm fairly certain I need to use draw_string, but I don't know what the
font argument is supposed to be.

So far, the appropriate lines say

        my $font_gc = new Gtk::Gdk::GC ( $widget->window );
        my $fontcolor = $widget->window->get_colormap->color_alloc(
                        { red => 0, green => 0, blue => 0 } );

        $graph->draw_string( $font_gc, 'what goes here?', 
                        20, 20, "Hello, World" );

According to the error message, its supposed to be of type
Gtk::Gdk::Font, but how do I specify it?

Thanks

-- 
Cameron Kerr
Email:   cameron kerr paradise net nz
Website: http://nzgeeks.org/cameron/




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