After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667008 - GtkTextView should implement GtkEditable?
GtkTextView should implement GtkEditable?
Status: RESOLVED DUPLICATE of bug 629288
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-12-29 21:36 UTC by Murray Cumming
Modified: 2013-03-28 18:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2011-12-29 21:36:48 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);
    }
  }
}
Comment 1 Sébastien Wilmet 2013-03-28 18:29:11 UTC

*** This bug has been marked as a duplicate of bug 629288 ***