Re: Removing a pixmap from a Gtk::CtreeNode
- From: Paolo Molaro <lupus ximian com>
- To: gtk-perl-list gnome org
- Subject: Re: Removing a pixmap from a Gtk::CtreeNode
- Date: Sat, 17 Nov 2001 20:00:33 +0100
On 11/12/01 Raul Dias wrote:
I am wondering how does a a pixmap works inside a node/row in a Gtk::CTree
(or Gtk::CList) and what's the best way to remove/clean it.
AFAIK (please correct me if I am wrong), a Gtk::Gdk::Pixmap is the pixmap stored
in the X11 server itself and a Gtk::Pixmap is a widget which can be used to display
a Gtk::Gdk::Pixmap.
To add a pixmap in the 2nd column of a Gtk::CTreeNode I use:
$ctree->node_set_pixmap( $node, 1, $gtk_gdk_pixmap, $mask);
Now when I retrieve it to destroy() it I use:
($pixmap, $mask) = $ctree->node_get_pixmap( $node, 1);
However $pixmap is a Gtk::Gdk::Pixmap and not a Gtk::Pixmap,
which means that I can't destroy() it.
A Gtk::Gdk::Pixmap will be automatically destroyed when it's reference
count drops to 0, you don't need to do anything. The same holds true for
widgets (except Gtk::Window ones: they are special since they are
toplevel widgets).
So, I ask: Did the Gtk::CTreeNode create and Gtk::Pixmap, when I inserted it?
If so, how can I retrieve it (to destroy and free memory) ?
Gtk::CTreeNode didn't create a Gtk::Pixmap. If you want the
Gtk::Gdk::Pixmap to disappear, use:
$ctree->node_set_text ($node, $column, "");
If not, how does it work? how can I clean the column (cell) ?
Right now I am using $ctree->node_set_text ( '', 1);
However knowing gtk+, I would suppose it creates a label (empty) to place in there.
Nope, the Gtk::CTree widget renders the cell contents itself, it doesn't
create label widgets at all.
lupus
--
-----------------------------------------------------------------
lupus debian org debian/rules
lupus ximian com Monkeys do it better
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]