[gtkmm] Gtk::CellRenderer: Text below a pixmap
- From: Samuel <spam debain org>
- To: gtkmm-list gnome org
- Subject: [gtkmm] Gtk::CellRenderer: Text below a pixmap
- Date: Fri, 02 Apr 2004 23:34:48 +0200
Hello All,
I am trying to create a treeview with one column, having labeled icons
in every cell.
The problem is that the CellRendererText is shown /right/ from the icon.
But how can I add the renderer below the icon?
I have appended what I have done so far.
Thanks!
-Samuel
------------------------------------------
// The treeview columns.
class ModelColumns : public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > pixbuf;
ModelColumns() {
add(pixbuf);
}
};
Glib::RefPtr<Gtk::ListStore> store;
Gtk::CellRendererText renderer_text;
ModelColumns columns;
// Create a liststore and attach it to a view.
store = Gtk::ListStore::create(columns);
treeview->set_model(store);
Gtk::TreeModel::Row row = *store->append();
// Add a row with one icon.
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
pixbuf = Gdk::Pixbuf::create_from_file("gnome-util.png");
categories->append_column("Category", columns.pixbuf);
row[columns.pixbuf] = pixbuf;
// Add a text renderer below the icon.
categories->get_column(0)->pack_end(renderer_text, TRUE);
------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]