[gtkmm] libglibmm2.3.2 ==0 instead of is_null() question



hi,

i am using debian unstable, so im used to get a little trouble
with the latest "unstable" libs/dev-libs.

i have a small glademm project on which i stopped working much
weeks ago, and today i tried to compile it again...
...with many apt-get upgrades between, so my libs and header
files got out of sync.

i had a refptr.h with an is_null() function and in my old code i
used it. but i already had the newer runtime lib, so the compiler
got an error...

okay, thats a debian issue, and finally i found it.

i also found somewhere the note, that i should use
== 0 instead of .is_null() on RefPtr<>'s.

now my question:
why does this code compile:
	...
	Gtk::ListStore::iterator i = Listing->get_iter(p);
	Gtk::TreeRow r = *i;
	Glib::RefPtr<Gdk::Pixbuf> rp = r[mcols.icon];
	if(rp == 0) {
	...
but this gives me compiler errors:
	...
	Gtk::ListStore::iterator i = Listing->get_iter(p);
	Gtk::TreeRow r = *i;
	if((r[mcols.icon]) == 0) {
	...

errors:

window1.cc: In member function `void window1::on_break(Gtk::TreePath, 
   Gtk::TreeViewColumn*)':
window1.cc:83: error: no match for 'operator==' in '
   Gtk::TreeRow::operator[](const Gtk::TreeModelColumn<ColumnType>&) const 
   [with ColumnType = Glib::RefPtr<Gdk::Pixbuf>]((this + 92)) == 0'
/usr/include/gtkmm-2.0/gtkmm/stockid.h:57: error: candidates are: bool 
   Gtk::operator==(const Gtk::StockID&, const Gtk::StockID&)
/usr/include/gtkmm-2.0/gtkmm/treemodelcolumn.h:113: error:                 bool 
   Gtk::operator==(const Gtk::TreeModelColumnBase&, const 
   Gtk::TreeModelColumnBase&)
/usr/include/gtkmm-2.0/gtkmm/treeiter.h:168: error:                 bool 
   Gtk::operator==(const Gtk::TreeIter&, const Gtk::TreeIter&)
/usr/include/gtkmm-2.0/gtkmm/treepath.h:345: error:                 bool 
   Gtk::operator==(const Gtk::TreePath&, const Gtk::TreePath&)
/usr/include/gtkmm-2.0/gtkmm/textiter.h:961: error:                 bool 
   Gtk::operator==(const Gtk::TextIter&, const Gtk::TextIter&)
/usr/include/gtkmm-2.0/glibmm/quark.h:72: error:                 bool 
   Glib::operator==(const Glib::QueryQuark&, const Glib::QueryQuark&)
/usr/include/gtkmm-2.0/glibmm/timeval.h:183: error:                 bool 
   Glib::operator==(const Glib::TimeVal&, const Glib::TimeVal&)
/usr/include/gtkmm-2.0/glibmm/date.h:179: error:                 bool 
   Glib::operator==(const Glib::Date&, const Glib::Date&)
/usr/include/gtkmm-2.0/glibmm/ustring.h:809: error:                 bool 
   Glib::operator==(const char*, const Glib::ustring&)
/usr/include/gtkmm-2.0/glibmm/ustring.h:805: error:                 bool 
   Glib::operator==(const Glib::ustring&, const char*)
/usr/include/gtkmm-2.0/glibmm/ustring.h:801: error:                 bool 
   Glib::operator==(const Glib::ustring&, const Glib::ustring&)
/usr/include/gtkmm-2.0/gdkmm/region.h:201: error:                 bool 
   Gdk::operator==(const Gdk::Region&, const Gdk::Region&)
/usr/include/gtkmm-2.0/gdkmm/color.h:134: error:                 bool 
   Gdk::operator==(const Gdk::Color&, const Gdk::Color&)
/usr/include/gtkmm-2.0/gdkmm/types.h:322: error:                 bool 
   Gdk::operator==(const Gdk::Point&, const Gdk::Point&)
make: *** [window1.o] Error 1


i am using gcc version 3.3.3 (Debian 20040401)

maybe other wrong lib/header files?

concerning this, i believe my understanding of c++ is not 
completly correct :)

thanks for any hints or ideas!

-- 

Florian Schmidt
schmidt_florian gmx de



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