utils/gtk.h file

Contents

GTK utils.

Enums

enum ZGtkFill { Z_GTK_NO_FILL, Z_GTK_FILL }
For readability, instead of using 0s and 1s.

Functions

auto z_gtk_message_dialog_get_label(GtkMessageDialog* self, const int secondary) -> GtkLabel*
Returns the primary or secondary label of the given GtkMessageDialog.
void z_gtk_configure_simple_combo_box(GtkComboBox* cb, GtkTreeModel* model)
Configures a simple value-text combo box using the given model.
auto z_gtk_button_new_with_icon(const char* name) -> GtkButton*
Creates a button with the given icon name.
auto z_gtk_toggle_button_new_with_icon(const char* name) -> GtkToggleButton*
Creates a toggle button with the given icon name.
auto z_gtk_button_new_with_resource(IconType icon_type, const char* name) -> GtkButton*
Creates a button with the given resource name as icon.
auto z_gtk_toggle_button_new_with_resource(IconType icon_type, const char* name) -> GtkToggleButton*
Creates a toggle button with the given resource name as icon.
auto z_gtk_get_single_selection_pointer(GtkTreeView* tv, int column) -> void*
Returns a pointer stored at the given selection.
auto z_gtk_get_label_from_menu_item(GtkMenuItem* mi) -> GtkLabel*
Returns the label from a given GtkMenuItem.
void z_gtk_set_tooltip_for_actionable(GtkActionable* actionable, const char* tooltip)
Sets the tooltip and finds the accel keys and appends them to the tooltip in small text.
void z_gtk_tool_button_set_icon_size(GtkToolButton* toolbutton, GtkIconSize icon_size)
Changes the size of the icon inside tool buttons.
void z_gtk_widget_add_style_class(GtkWidget* widget, const gchar* class_name)
Adds the given style class to the GtkWidget.
static auto z_gtk_widget_get_device(GtkWidget* widget) -> GdkDevice*
Gets the GdkDevice for a GtkWidget.
static void z_gtk_warp_cursor_to(GtkWidget* widget, int x, int y)
Wraps the cursor to the given global coordinates.
static void z_gtk_widget_get_mask(GtkWidget* widget, GdkModifierType* mask)
Sets the GdkModifierType given for the widget.
static auto z_gtk_keyval_is_alt(const guint keyval) -> int
Returns if the keyval is an Alt key.
static auto z_gtk_keyval_is_ctrl(const guint keyval) -> int
Returns if the keyval is a Control key.
static auto z_gtk_keyval_is_arrow(const guint keyval) -> int
Returns if the keyval is an arrow key.
static auto z_gtk_keyval_is_shift(const guint keyval) -> int
Returns if the keyval is a Shift key.
static auto z_gtk_container_get_single_child(GtkContainer* container) -> GtkWidget*
Returns the single child of a container.
auto z_gtk_container_get_nth_child(GtkContainer* container, int index) -> GtkWidget*
Returns the nth child of a container.
void z_gtk_combo_box_set_ellipsize_mode(GtkComboBox* self, PangoEllipsizeMode ellipsize)
Sets the ellipsize mode of each text cell renderer in the combo box.
void z_gtk_setup_foldable_notebook(GtkNotebook* notebook)
Makes the given notebook foldable.
void z_gtk_widget_set_margin(GtkWidget* widget, int margin)
Sets the margin on all 4 sides on the widget.
auto z_gtk_activate_dir_link_func(GtkLabel* label, char* uri, void* data) -> bool
Callback to use for simple directory links.