Re: Circles and DrawingAreas
- From: dov imagic weizmann ac il
- To: gtk-perl-list gnome org
- Cc: dpf umr edu
- Subject: Re: Circles and DrawingAreas
- Date: Tue, 31 Jul 2001 16:17:00 IDT
Big ooops...
The following should be better:
$drawing_area = Gtk::DrawingArea->new();
:
$my_gc = new Gtk::Gdk::GC $drawing_area->window;
$colormap = $drawing_area->window->get_colormap;
$my_gc->set_foreground(get_color($colormap, "red"));
$drawing_area->window->draw_arc($my_gc, 1,
$cx-3,$cy-3, 7,7, 0,360*64);
:
{
my %allocated_colors;
sub get_color {
my ($colormap, $name) = @_;
my $ret;
if ($ret = $allocated_colors{$colormap . $name}) {
return $ret;
}
$ret = $colormap->color_alloc(Gtk::Gdk::Color->parse_color($name));
$allocated_colors{$colormap . $name} = $ret;
return $ret;
}
}
Dov
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]