Using a Const Gtk::TextBuffer Object?
- From: Ami Tavory <atavory gmail com>
- To: gtkmm-list gnome org
- Subject: Using a Const Gtk::TextBuffer Object?
- Date: Tue, 22 Nov 2005 13:42:20 +0200
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]