Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 GTK TextView,我需要将选定的文本放入一个字符串中,我该怎么做?
TextView
有事件SelectionGet,但似乎不起作用。(从未触发)
public string Selection { get { Gtk.TextIter A; Gtk.TextIter B; if (textView.Buffer.GetSelectionBounds(out A, out B)) { return textView.Buffer.GetText(A, B, true); } // return null when there is no selection return null; } }