mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 03:15:26 +00:00
de34331936
* gdk/Selection.custom : add static fields for the primary, secondary, and clipboard and clipboard selection Gdk.Atoms. * glue/Makefile.am : add selection.c * glue/selection.c : add glue to get the atoms. * gtk/TextBuffer.custom : add a PasteClipboard overload for pasting to the cursor location. svn path=/trunk/gtk-sharp/; revision=16130
34 lines
782 B
Plaintext
34 lines
782 B
Plaintext
public string Text {
|
|
get {
|
|
return GetText (StartIter, EndIter, false);
|
|
}
|
|
|
|
set {
|
|
gtk_text_buffer_set_text (Handle, value,
|
|
System.Text.Encoding.UTF8.GetByteCount(value));
|
|
}
|
|
}
|
|
|
|
public void Clear ()
|
|
{
|
|
Delete (StartIter, EndIter);
|
|
}
|
|
|
|
public Gtk.TextIter GetIterAtOffset(int char_offset)
|
|
{
|
|
Gtk.TextIter iter;
|
|
|
|
gtk_text_buffer_get_iter_at_offset(Handle, out iter, char_offset);
|
|
|
|
return iter;
|
|
}
|
|
|
|
// overload to paste clipboard contents at cursor editable by default.
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
static extern void gtk_text_buffer_paste_clipboard (IntPtr raw, IntPtr clip, IntPtr iter, bool default_edit);
|
|
public void PasteClipboard (Gtk.Clipboard clipboard)
|
|
{
|
|
gtk_text_buffer_paste_clipboard(Handle, clipboard.Handle, IntPtr.Zero, true);
|
|
}
|
|
|