GNOME Bugzilla – Bug 667008
GtkTextView should implement GtkEditable?
Last modified: 2013-03-28 18:29:11 UTC
It would be convenient if GtkTextView could implement GtkEditable. That would make it easier to implement signal handlers for Cut/Copy/Paste menu items, which currently need to special-case GtkTextView, as in the C++ example code from Glom below. At the least, it would be nice to have gtk_tree_view_cut/copy/paste_clipboard() functions to avoid worrying about the clipboard, display, and selection each time. void App_WithDoc_Gtk::on_menu_edit_paste_activate() { Gtk::Widget* widget = get_focus(); Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget); if(editable) { editable->paste_clipboard(); return; } //GtkTextView does not implement GtkTextView: Gtk::TextView* textview = dynamic_cast<Gtk::TextView*>(widget); if(textview) { Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer(); if(buffer) { Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get_for_display(get_display()); buffer->paste_clipboard(clipboard); } } }
*** This bug has been marked as a duplicate of bug 629288 ***