Re: GC sometimes without a colormap
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: GC sometimes without a colormap
- Date: Tue, 13 Feb 2007 13:21:33 +0100
On Tue, Feb 13, 2007 at 01:38:29PM +0200, Ari Jolma wrote:
>
> $pm = Gtk2::Gdk::Pixmap->new(undef,10,10,24);
> $gc = new Gtk2::Gdk::GC $pm;
> $gc->set_rgb_fg_color(Gtk2::Gdk::Color->new(0,0,0));
> $pm->draw_rectangle($gc,1,0,0,10,10);
> $pb = Gtk2::Gdk::Pixbuf->get_from_drawable($pm,undef,0,0,0,0,10,10);
>
> The idea is to create small (10x10) pixbufs with varying colors for
> inserting them into the model of a treeview.
Why you don't just create the pixbufs and fill them with the
required color (which can be done with gdk_pixbuf_fill() or
with Cairo if you want more complex drawing), and go through
pixmaps that use server-side resource... instead?
It's also possible to create just one pixbuf and fill it
with the corresponding color in the cell data function of
the tree view.
Yeti
--
Whatever.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]