-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidget.cs
36 lines (28 loc) · 1.4 KB
/
Widget.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Runtime.InteropServices;
namespace Gtk3
{
public abstract class Widget
{
public delegate void WidgetCallBack();
public delegate void WidgetCallBack2Arg(IntPtr widget, IntPtr data);
public abstract IntPtr Handle { get; }
public virtual void ConnectSignal(string detailedSignal, WidgetCallBack callback, IntPtr data, NativeMethods.GClosureNotify destroyData)
{
NativeMethods.g_signal_connect_data(Handle, detailedSignal,
Marshal.GetFunctionPointerForDelegate(callback), data,
destroyData, GConnectFlags.ConnectAfter);
}
public virtual void ConnectSignal(string detailedSignal, WidgetCallBack2Arg callback, IntPtr data, NativeMethods.GClosureNotify destroyData)
{
NativeMethods.g_signal_connect_data(Handle, detailedSignal,
Marshal.GetFunctionPointerForDelegate(callback), data,
destroyData, GConnectFlags.ConnectAfter);
}
public virtual void ConnectSignalSwapped(string detailedSignal, WidgetCallBack2Arg callBack, IntPtr data,
NativeMethods.GClosureNotify destroyData) {
NativeMethods.g_signal_connect_data(Handle, detailedSignal, Marshal.GetFunctionPointerForDelegate(callBack), data,
destroyData, GConnectFlags.ConnectSwapped);
}
}
}