mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-08 07:53:17 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* gtk/Gtk.metadata : hide the button_new_from_stock ctor. * gtk/Button.custom : add a manual ctor implementation. svn path=/trunk/gtk-sharp/; revision=29598
40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
// 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);
|
|
}
|
|
}
|