Re: How unset a TreeView's model ?
- From: Claudio Polegato Junior <cpolegatojr_lsts pop com br>
- To: SAS <sasbelial yahoo fr>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: How unset a TreeView's model ?
- Date: Thu, 24 Nov 2005 10:06:15 +0000
SAS escreveu:
If the tree_view already has a model set, it will remove it before setting the new model. If model is 0, then it will unset the old model.
Hi,
This is a documentation problem wich was imported from GTK+
documentation. The right is model to be Glib::RefPrt<TreeModel> point to
NULL. See the example:
#include <stdio.h>
#include <gtkmm.h>
int main(int argc, char* argv[]){
Gtk::Main Aplicativo(argc, argv);
Glib::RefPtr<Gtk::TreeModel> *Model = new Glib::RefPtr<Gtk::TreeModel>;
printf("RefPtr: %p\n", Model);
printf(" Model: %p\n", Model->operator->());
printf("------> Clear\n", Model->operator->());
Model->clear(); // You can also clear a RefPtr. This is not need here,
but functions very well!
printf("RefPtr: %p\n", Model);
printf(" Model: %p\n", Model->operator->());
Gtk::TreeView *TreeView = new Gtk::TreeView;
TreeView->set_model(*Model);
// You can try this too, but you can't delete this RefPtr after.
TreeView->set_model(*(new Glib::RefPtr<Gtk::TreeModel>));
delete Model;
delete TreeView;
return 0;
}
--
[]'s
Claudio Polegato Junior
Um peregrino de Problemas; Um pergaminho de Soluções.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]