See: https://developer.gnome.org/gtk3/stable/GtkWidget.html
gtk :: GtkWidget :: defaultinit
gtk :: 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
core :: 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.
core :: Pointer :: defaultinit
core :: Object :: defaultinit
gtk :: GtkWidget :: defaultinit
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 :: 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 :: GtkCalendar
Displays a calendar and allows the user to select a dategtk :: GtkAlignment
A widget which controls the alignment and size of its childgtk :: GtkAssistant
A widget used to guide users through multi-step operationsgtk :: GtkSpinButton
Retrieve an integer or floating-point number from the user
# Base class for all widgets
# See: https://developer.gnome.org/gtk3/stable/GtkWidget.html
extern class GtkWidget `{GtkWidget *`}
fun show_all `{ gtk_widget_show_all(self); `}
fun signal_connect(signal_name: String, to_call: GtkCallable, user_data: nullable Object) import String.to_cstring, GtkCallable.signal, Object.as not nullable `{
NitGtkSignal *data = malloc(sizeof(NitGtkSignal));
GtkCallable_incr_ref(to_call);
Object_incr_ref(user_data);
data->to_call = to_call;
data->user_data = user_data;
/*Use G_CALLBACK() to cast the callback function to a GCallback*/
g_signal_connect(self,
String_to_cstring(signal_name),
G_CALLBACK(nit_gtk_callback_func),
data);
`}
redef fun ==(o) do return o isa GtkWidget and equal_to_gtk_widget(o)
private fun equal_to_gtk_widget(o: GtkWidget): Bool `{
return self == o;
`}
# Set the minimum dimension of this widget
fun set_size_request(width, height: Int) `{
gtk_widget_set_size_request(self, width, height);
`}
fun bg_color=(state: GtkStateType, color: GdkRGBA) `{
gtk_widget_override_background_color(self, state, color);
`}
# with gtk it's possible to set fg_color to all widget: is it correct? is fg color inherited?
# GdkColor color;
fun fg_color=(state: GtkStateType, color: GdkRGBA) `{
gtk_widget_override_color(self, state, color);
`}
# Sets the sensitivity of a widget. sensitive -> the user can interact with it.
# Insensitive -> widget "grayed out" and the user can"t interact with them
fun sensitive=(sensitive: Bool) `{
gtk_widget_set_sensitive(self, sensitive);
`}
# return the sensitivity of the widget
fun sensitive: Bool `{
return gtk_widget_get_sensitive(self);
`}
# Set the visibility of the widget
fun visible=(visible: Bool) `{
gtk_widget_set_visible(self, visible);
`}
# Get the visibility of the widget only
fun visible_self: Bool `{
return gtk_widget_get_visible(self);
`}
# Destroy the widget
fun destroy `{ gtk_widget_destroy(self); `}
# Show the widget on screen
#
# See: `show_all` to recursively show this widget and contained widgets.
fun show `{ gtk_widget_show(self); `}
# Hide the widget (reverse the effects of `show`)
fun hide `{ gtk_widget_hide(self); `}
# Vertical alignement of this widget
fun valign=(value: GtkAlign) `{ gtk_widget_set_valign(self, value); `}
# Horizontal alignement of this widget
fun halign=(value: GtkAlign) `{ gtk_widget_set_halign(self, value); `}
end
lib/gtk/v3_4/gtk_core.nit:68,1--147,3