Re: [gtkmm] Problem with Gdk::Pixbuf in Gtk::TreeView



Am 2003.09.04 17:00 schrieb(en) Simon Fuhrmann:
Hi!

On Wed, Sep 03, 2003 at 09:51:53PM +0200, Martin Schulze wrote:
>>  /* FIXME: This relation causes errors */
>>  this->tree_view.append_column ("Icon", this->column_set.icon);
>>  /* This works. */
>>  this->tree_view.append_column ("Filename",
>>  this->column_set.filename);
>>  this->tree_view.append_column ("Size", this->column_set.size);
>>  this->tree_view.append_column ("UID", this->column_set.uid);
>>  this->tree_view.append_column ("GID", this->column_set.gid);
>>  this->tree_view.append_column ("Blocks", this->column_set.
blocks);
>>  this->tree_view.append_column ("Hlink", this->column_set.hlink);
>>}

>> I figured out that the problem has something to do with the
relation
>> of
>> the Gtk::TreeView::Column and the Gtk::ModelViewColumn. Because the
>> error messages appear even if I omit filling a
>> Glib::RefPtr<Gdk::Pixbuf>
>> into the store. If I create the Gtk::TreeView::Column manually with
a
>> Gtk::CellRendererPixbuf without that relation, I don't get this
error
>> message (but no pixbufs aswell, of corse).

> Try to append the manually created column and see if it works then.

I have tried, but like I said, the problem appears only if I establish
the connection between the Gtk::TreeView::Column and the
Gtk::ModelView::Column. For example this code does not generate
errors:

  Gtk::CellRendererPixbuf *imagerenderer =
      Gtk::manage(new Gtk::CellRendererPixbuf);
  Gtk::TreeViewColumn* iconcolumn =
      Gtk::manage(new Gtk::TreeViewColumn("Icon", *imagerenderer));
  this->tree_view.append_column (*iconcolumn);

Sorry, I haven't been very clear.
I meant you should try exactly this but insert the line

iconcolumn->set_renderer(*imagerenderer, this->columns_set.icon);

before appending the column to the treeview (I don't know if the
order matters). This is the way you would set up a column if you
needed to specify the cellrenderer type explicitly (like e.g. the
custom cellrenderer type CellRendererList in the examples).

But I have no relation and no Pixbufs. This code does not work and
produces the same errors I was talking about:

If the code above produces the same errors then the bug is somewhere
else. I think it would be best if you would file a bug at bugzilla
(http://www.bugzilla.org) and attach a small-as-possible test case
to coordinate further investigations.

Regards,

  Martin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]