Using a Const Gtk::TextBuffer Object?



  Hello,

  I've noticed that the method:
Glib::ustring Gtk::TextBuffer::get_text(bool include_hidden_chars=true);
  is non-const. Is this by design? Since it returns a Glib::ustring, *not* a reference, shouldn't it logically avoid
modifying a Gtk::TextBuffer object?

  I've run into this problem while writing a widget that subclasses Gtk::TextView, but has a more Gtk::Entry-like interface. I can only implement my widget's
  Glib::ustring get_text() const
 member by const-casting in the body of the method. Shouldn't the const-cast be (if at all) in the body of Gtk::TextBuffer::get_text?

  Thanks,

  Ami


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