diff --git a/Gtkmm3/gtk94_clipboard/src/MyWin.cc b/Gtkmm3/gtk94_clipboard/src/MyWin.cc index eb542d4..a22cd71 100644 --- a/Gtkmm3/gtk94_clipboard/src/MyWin.cc +++ b/Gtkmm3/gtk94_clipboard/src/MyWin.cc @@ -57,7 +57,12 @@ void MyWin::buffer1_changed(){ void MyWin::btncopy_clicked(){ //Get Text Glib::ustring text; - text=buffer1->get_text(); + Gtk::TextBuffer::iterator start,end; + if(buffer1->get_selection_bounds(start,end)){ + text=buffer1->get_text(start,end); + }else{ + text=buffer1->get_text(); + } //Get Clipboard and set text auto refClipboard=Gtk::Clipboard::get();