Ryujinx-GtkSharp/gtk/Button.custom

40 lines
1.0 KiB
Plaintext
Raw Normal View History

// Gtk.Button.custom - Gtk Button class customizations
//
// Author: Mike Kestner <mkestner@ximian.com>
//
// Copyright (C) 2004 Novell, Inc.
//
// This code is inserted after the automatically generated code.
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_button_new_from_stock(string stock_id);
public Button (string stock_id) : base (IntPtr.Zero)
{
if (GetType () != typeof (Button)) {
GLib.Value[] vals = new GLib.Value [2];
string[] names = new string [2];
names [0] = "label";
vals [0] = new GLib.Value (stock_id);
names [1] = "use_stock";
vals [1] = new GLib.Value (true);
CreateNativeObject (names, vals);
return;
}
Raw = gtk_button_new_from_stock(stock_id);
}
[DllImport("gtksharpglue")]
static extern int gtksharp_button_get_in_button (IntPtr button);
[DllImport("gtksharpglue")]
static extern void gtksharp_button_set_in_button (IntPtr button, int b);
public bool InButton {
get {
return gtksharp_button_get_in_button (Handle) == 1 ? true : false;
}
set {
gtksharp_button_set_in_button (Handle, value ? 1 : 0);
}
}