See: https://developer.gnome.org/gtk3/stable/GtkButton.html
gtk :: GtkButton :: defaultinit
gtk :: GtkButton :: from_stock
gtk :: GtkButton :: with_label
Create a GtkButton with textcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
gtk :: GtkButton :: defaultinit
gtk :: GtkBin :: defaultinit
core :: Pointer :: defaultinit
gtk :: GtkWidget :: defaultinit
core :: Object :: defaultinit
gtk :: GtkContainer :: defaultinit
gtk :: GtkButton :: from_stock
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).gtk :: GtkContainer :: resize_mode
Get the resize mode of the containergtk :: GtkContainer :: resize_mode=
Set the resize mode of the containergtk :: GtkWidget :: sensitive=
Sets the sensitivity of a widget. sensitive -> the user can interact with it.gtk :: GtkWidget :: set_size_request
Set the minimum dimension of this widgetgtk :: GtkWidget :: signal_connect
gtk :: GtkButton :: with_label
Create a GtkButton with text
# A widget that emits a signal when clicked on
# See: https://developer.gnome.org/gtk3/stable/GtkButton.html
extern class GtkButton `{GtkButton *`}
super GtkBin
new `{
return (GtkButton *)gtk_button_new();
`}
# Create a GtkButton with text
new with_label(text: String) import String.to_cstring `{
return (GtkButton *)gtk_button_new_with_label(String_to_cstring(text));
`}
new from_stock(stock_id: String) import String.to_cstring `{
return (GtkButton *)gtk_button_new_from_stock(String_to_cstring(stock_id));
`}
fun text: String import CString.to_s `{
return CString_to_s((char *)gtk_button_get_label(self));
`}
fun text=(value: String) import String.to_cstring `{
gtk_button_set_label(self, String_to_cstring(value));
`}
fun on_click(to_call: GtkCallable, user_data: nullable Object) do
signal_connect("clicked", to_call, user_data)
end
# Set the image of button to the given widget
fun image=(image: GtkWidget) `{
gtk_button_set_image(self, image);
`}
# Get the widget that is currenty set as the image of button
fun image: GtkWidget `{
return gtk_button_get_image(self);
`}
end
lib/gtk/v3_4/gtk_core.nit:788,1--827,3