本文整理汇总了C#中Gtk.Set方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Set方法的具体用法?C# Gtk.Set怎么用?C# Gtk.Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.Set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearGet
private void ClearGet(Gtk.Clipboard clipboard, Gtk.SelectionData selection, uint info) {
StringBuilder temp = new StringBuilder();
temp.Append(outData.Operation == ClipboardOperationType.Cut ? "cut" : "copy");
foreach(Uri path in outData.Paths) {
temp.Append('\n');
temp.Append(path.ToString());
}
selection.Set(selection.Target, 8, Encoding.ASCII.GetBytes(temp.ToString()));
}
示例2: ClipboardGet
static void ClipboardGet (Gtk.Clipboard clipboard, Gtk.SelectionData seldata, uint info)
{
if (selection == null)
return;
if (info == TextType)
seldata.Text = selection.OuterXml;
else
seldata.Set (WidgetUtils.ApplicationXSteticAtom, 8, System.Text.Encoding.UTF8.GetBytes (selection.OuterXml));
}
示例3: Copy
public static void Copy(Gtk.Widget widget, Gtk.SelectionData seldata, bool copyAsText)
{
XmlDocument doc = Export (widget);
if (doc == null)
return;
if (copyAsText)
seldata.Text = doc.OuterXml;
else
seldata.Set (ApplicationXGladeAtom, 8, System.Text.Encoding.UTF8.GetBytes (doc.OuterXml));
}
示例4: SetSelectionData
public static void SetSelectionData (Gtk.SelectionData data, string atomType, object val)
{
if (val == null)
return;
if (val is string)
data.Text = (string)val;
else if (val is Xwt.Drawing.Image) {
var bmp = ((Image)val).ToBitmap ();
data.SetPixbuf (((GtkImage)Toolkit.GetBackend (bmp)).Frames[0].Pixbuf);
}
else {
var at = Gdk.Atom.Intern (atomType, false);
data.Set (at, 0, TransferDataSource.SerializeValue (val));
}
}
示例5: Copy
public static void Copy (Gtk.Widget widget, Gtk.SelectionData seldata, bool copyAsText)
{
XmlElement elem = ExportWidget (widget);
if (elem == null)
return;
if (copyAsText)
seldata.Text = elem.OuterXml;
else
seldata.Set (ApplicationXSteticAtom, 8, System.Text.Encoding.UTF8.GetBytes (elem.OuterXml));
}
示例6: SetSelectionData
public static void SetSelectionData(Gtk.SelectionData data, string atomType, object val)
{
if (val == null)
return;
if (val is string)
data.Text = (string)val;
else if (val is Xwt.Drawing.Image)
data.SetPixbuf ((Gdk.Pixbuf) WidgetRegistry.GetBackend (val));
else {
var at = Gdk.Atom.Intern (atomType, false);
data.Set (at, 0, TransferDataSource.SerializeValue (val));
}
}
示例7: OnDragDataGet
protected override void OnDragDataGet (Gdk.DragContext ctx, Gtk.SelectionData data, uint info, uint time)
{
byte[] uri = System.Text.Encoding.UTF8.GetBytes (Hit.EscapedUri + "\r\n");
data.Set (data.Target, 8, uri);
}