[prev in list] [next in list] [prev in thread] [next in thread]
List: gtkmm
Subject: Re: [gtkmm] Gdk_Pixmaps in Gtk::CList
From: Daniel <dss () home ! se>
Date: 2001-08-30 0:09:54
[Download RAW message or body]
On Wed, 29 Aug 2001 18:12:22 -0400 (EDT)
"Jason M'Sadoques" <jsado@mediaone.net> wrote:
> I am trying to use a Gdk_Pixmap in a Gtk::CList to have a list of graphics with \
> text beside them, allowing the user to select one.
>
> When I try to new a Gdk_Pixmap like so:
>
> Gdk_Pixmap *color_block=new Gdk_Pixmap;
>
> I get this compile-time error:
>
> palette.cpp: In method `void color_dialog::clist::redisplay_list()':
> /usr/include/gdk--/types.h:277: `static void * Gdk_Handle<_GdkWindow>::operator \
> new(unsigned int)' is private palette.cpp:75: within this context
>
> Why has new been made private for the Gdk_Pixmap? Is there some other way to \
> dynamically create and distroy a large number of Gdk_Pixmaps that are to be placed \
> in a Gtk::CList?
> Any help would be appreciated.
>
Well, I'm just back from the pub but I'll try to help anyway... The only way I got a \
pixmap into a clist was by looking at the code in gtkmail (from another developer on \
this list). I came up with the following code:
in foo.h:
Gtk::ImageLoader *il;
in constructor:
il = new Gtk::ImageLoader("pixmap.xpm");
somewhere else:
cell( row, col ).set_pixmap( il->pix(), il->bit() );
I am very tired now and I don't know if it was this you wanted to know but anyway...
I never got a pixmap into a clist directely, I had to go through a Gtk::ImageLoader. \
I don't know if this is the right way to do it but it works.
/Daniel
--
/*
* dss@home.se
* http://sumpan.campus.luth.se
* http://sumpan.campus.luth.se/software
*/
_______________________________________________
to unsubscribe or change your subscription parameters :
http://lists.sourceforge.net/lists/listinfo/gtkmm-main
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic