I've seen various "inaccessible base errors" in searching on Google, but
I couldn't quite find this one and I don't understand quite what's going on.

I have a class, FileEntry (which consists of an entry widget and a
button that spawns a file selection dialog from Gtkmm):

class FileEntry : protected Gtk::HBox
{
public:
  FileEntry(bool open=true,
            std::string defaultname="");
protected:
  void on_button();
  ...stuff...
};

(Note that it inherits from _protected_ HBox)

Now, in FileEntry::FileEntry, I need to connect the button clicked event
for said button to a handler. Thus I create the slot with this line:

sigc::slot<void> sl = sigc::mem_fun(*this, &FileEntry::on_button);

Sadly, I now get these g++ error:

/usr/include/sigc++-2.0/sigc++/type_traits.h: In instantiation of 'const
bool sigc::is_base_and_derived<sigc::trackable, rjs::FileEntry>::value':
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1792:   instantiated
from 'sigc::bound_mem_functor0<void, rjs::FileEntry>'
FileEntry.cc:11:   instantiated from here
/usr/include/sigc++-2.0/sigc++/type_traits.h:132: error:
'sigc::trackable' is an inaccessible base of 'rjs::FileEntry'

Now then, I can compile happily by inheriting from public Gtk::HBox, but
this really doesn't seem like it should be necessary - surely as we're
in the constructor the public/private/whatever should make no difference?

I'd really like to know what the heck's going on here - does mem_fun do
something very wierd?

Sorry for the specifically Gtkmm question, but I presume that the actual
issue at work is general enough here that it still applies? Also - this
is the only list I could find for sigc++ - I hope it isn't purely a
developer list!

Rupert

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libsigc-list mailing list
libsigc-list@gnome.org
http://mail.gnome.org/mailman/listinfo/libsigc-list

Reply via email to