### Page Setup Dialog Implementation Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Example of using gtk_print_run_page_setup_dialog to manage page settings in C. ```C static GtkPrintSettings *settings = NULL; static GtkPageSetup *page_setup = NULL; static void do_page_setup (void) { GtkPageSetup *new_page_setup; if (settings == NULL) settings = gtk_print_settings_new (); new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window), page_setup, settings); if (page_setup) g_object_unref (page_setup); page_setup = new_page_setup; } ``` -------------------------------- ### Get Default Page Setup Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintOperationProtocol.html Retrieves the default page setup configuration. ```Swift @inlinable func getDefaultPageSetup() -> PageSetupRef! ``` -------------------------------- ### Initialize PadController with Actions Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PadController.html Example showing the definition of pad action entries and the setup of a GActionGroup to handle input events. ```C GtkPadActionEntry *pad_actions[] = { { GTK_PAD_ACTION_BUTTON, 1, -1, "Invert selection", "pad-actions.invert-selection" }, … }; … action_group = g_simple_action_group_new (); action = g_simple_action_new ("pad-actions.invert-selection", NULL); g_signal_connect (action, "activate", on_invert_selection_activated, NULL); g_action_map_add_action (G_ACTION_MAP (action_group), action); … pad_controller = gtk_pad_controller_new (action_group, NULL); ``` -------------------------------- ### Get Page Setup Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintContextProtocol.html Obtains the GtkPageSetup that determines the page dimensions of the GtkPrintContext. ```Swift @inlinable func getPageSetup() -> PageSetupRef! ``` -------------------------------- ### Render and Setup GLArea in C Source: https://rhx.github.io/SwiftGtk4Doc/Classes/GLArea.html Connect to the render signal to perform OpenGL drawing commands and use a setup function to initialize the widget. ```c static gboolean render (GtkGLArea *area, GdkGLContext *context) { // inside this function it's safe to use GL; the given // GdkGLContext has been made current to the drawable // surface used by the `GtkGLArea` and the viewport has // already been set to be the size of the allocation // we can start by clearing the buffer glClearColor (0, 0, 0, 0); glClear (GL_COLOR_BUFFER_BIT); // draw your object // draw_an_object (); // we completed our drawing; the draw commands will be // flushed at the end of the signal emission chain, and // the buffers will be drawn on the window return TRUE; } void setup_glarea (void) { // create a GtkGLArea instance GtkWidget *gl_area = gtk_gl_area_new (); // connect to the "render" signal g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); } ``` -------------------------------- ### Run Print Operation Example Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintOperationProtocol.html Example demonstrating the configuration and execution of a print operation using C-style GTK calls. ```C if (settings != NULL) gtk_print_operation_set_print_settings (print, settings); if (page_setup != NULL) gtk_print_operation_set_default_page_setup (print, page_setup); g_signal_connect (print, "begin-print", G_CALLBACK (begin_print), &data); g_signal_connect (print, "draw-page", G_CALLBACK (draw_page), &data); res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, parent, &error); if (res == GTK_PRINT_OPERATION_RESULT_ERROR) { error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error printing file:\n`s`", error->message); g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL); gtk_widget_show (error_dialog); g_error_free (error); } else if (res == GTK_PRINT_OPERATION_RESULT_APPLY) { if (settings != NULL) g_object_unref (settings); settings = g_object_ref (gtk_print_operation_get_print_settings (print)); } ``` -------------------------------- ### Run Page Setup Dialog Source: https://rhx.github.io/SwiftGtk4Doc/Functions.html Displays a page setup dialog. Note that this may use a recursive mainloop. ```Swift @inlinable public func printRunPageSetupDialog(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, settings: PrintSettingsT) -> PageSetupRef! where PrintSettingsT : PrintSettingsProtocol ``` -------------------------------- ### Get Start Child Method Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PanedProtocol.html Retrieves the start child of the GtkPaned. ```Swift @inlinable func getStartChild() -> WidgetRef! ``` -------------------------------- ### Initialize a new SwiftGtk project Source: https://rhx.github.io/SwiftGtk4Doc/index.html Use these commands to create a project directory and download the necessary build scripts. ```bash mkdir MyProject cd MyProject curl -L https://git.io/SwiftGtk4.sh | sh ./run-gir2swift.sh ``` -------------------------------- ### start() Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/SpinnerProtocol.html Starts the animation of the spinner. ```APIDOC ## func start() ### Description Starts the animation of the spinner. ### Declaration ```swift @inlinable func start() ``` ``` -------------------------------- ### Setting up a GtkApplicationWindow with a menubar Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ApplicationWindow.html Demonstrates initializing an application and attaching a menu bar defined via GtkBuilder. ```C GtkApplication *app = gtk_application_new ("org.gtk.test", 0); GtkBuilder *builder = gtk_builder_new_from_string ( "" " " " " " _Edit" " " " _Copy" " win.copy" " " " " " _Paste" " win.paste" " " " " " " "", -1); GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")); gtk_application_set_menubar (GTK_APPLICATION (app), menubar); g_object_unref (builder); // ... GtkWidget *window = gtk_application_window_new (app); ``` -------------------------------- ### Get Shrink Start Child Method Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PanedProtocol.html Returns whether the start child can be shrunk. ```Swift @inlinable func getShrinkStartChild() -> Bool ``` -------------------------------- ### Get Resize Start Child Method Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PanedProtocol.html Returns whether the start child can be resized. ```Swift @inlinable func getResizeStartChild() -> Bool ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ConstraintGuide.html Creates a new GtkConstraintGuide object. ```APIDOC ## init() ### Description Creates a new GtkConstraintGuide object. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Print Run Page Setup Dialog Async Source: https://rhx.github.io/SwiftGtk4Doc/Functions.html Runs a page setup dialog asynchronously, returning immediately and invoking a callback when the response signal is received. ```Swift @inlinable public func printRunPageSetupDialogAsync(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PrintSettingsT : PrintSettingsProtocol ``` ```Swift @inlinable public func printRunPageSetupDialogAsync(parent: WindowT?, pageSetup: PageSetupT?, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol, WindowT : WindowProtocol ``` -------------------------------- ### Get Start Widget Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/CenterBoxProtocol.html Retrieves the start widget, returning nil if none is set. ```Swift @inlinable func getStartWidget() -> WidgetRef! ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Creates a new GtkPageSetup instance. ```APIDOC ## init() ### Description Creates a new GtkPageSetup object. ### Declaration ```swift public init() ``` ``` -------------------------------- ### Run Page Setup Dialog Asynchronously Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WindowProtocol.html Opens a page setup dialog asynchronously, returning immediately and executing a callback upon completion. ```Swift @inlinable func printRunPageSetupDialogAsync(pageSetup: PageSetupRef? = nil, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PrintSettingsT : PrintSettingsProtocol ``` ```Swift @inlinable func printRunPageSetupDialogAsync(pageSetup: PageSetupT?, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol ``` -------------------------------- ### Initialize PageSetup from File Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Reads page setup configuration from a specified file path. ```Swift @inlinable public init(file fileName: UnsafePointer!) throws ``` -------------------------------- ### Get Embed Page Setup Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintOperationProtocol.html Checks if page setup selection combos are embedded. ```Swift @inlinable func getEmbedPageSetup() -> Bool ``` -------------------------------- ### init(title:parent:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetupUnixDialog.html Creates a new page setup dialog instance. ```APIDOC ## init(title:parent:) ### Description Creates a new page setup dialog. ### Signature `public init(title: UnsafePointer? = nil, parent: WindowT?) where WindowT : WindowProtocol` ### Parameters - **title** (UnsafePointer?) - Optional - The title of the dialog. - **parent** (WindowT?) - Optional - The parent window for the dialog. ``` -------------------------------- ### Get Line at Y Coordinate Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextViewProtocol.html Gets the text iterator at the start of the line containing the specified Y coordinate. ```Swift @inlinable func getLineAtY(targetIter: TextIterT, y: Int, lineTop: UnsafeMutablePointer!) where TextIterT : TextIterProtocol ``` -------------------------------- ### Get Item Row Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/IconViewProtocol.html Gets the row in which the item path is currently displayed. Row numbers start at 0. ```Swift @inlinable func getItemRow(path: TreePathT) -> Int where TreePathT : TreePathProtocol ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ShortcutController.html Creates a new shortcut controller. ```APIDOC ## init() ### Description Creates a new shortcut controller. ``` -------------------------------- ### Get Item Column Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/IconViewProtocol.html Gets the column in which the item path is currently displayed. Column numbers start at 0. ```Swift @inlinable func getItemColumn(path: TreePathT) -> Int where TreePathT : TreePathProtocol ``` -------------------------------- ### Initialize and configure a GtkListView Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ListView.html Demonstrates setting up a list item factory, binding data to list items, and handling activation events for a GtkListView. ```c static void setup_listitem_cb (GtkListItemFactory *factory, GtkListItem *list_item) { GtkWidget *image; image = gtk_image_new (); gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE); gtk_list_item_set_child (list_item, image); } static void bind_listitem_cb (GtkListItemFactory *factory, GtkListItem *list_item) { GtkWidget *image; GAppInfo *app_info; image = gtk_list_item_get_child (list_item); app_info = gtk_list_item_get_item (list_item); gtk_image_set_from_gicon (GTK_IMAGE (image), g_app_info_get_icon (app_info)); } static void activate_cb (GtkListView *list, guint position, gpointer unused) { GAppInfo *app_info; app_info = g_list_model_get_item (G_LIST_MODEL (gtk_list_view_get_model (list)), position); g_app_info_launch (app_info, NULL, NULL, NULL); g_object_unref (app_info); } ... model = create_application_list (); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL); g_signal_connect (factory, "bind", G_CALLBACK (bind_listitem_cb), NULL); list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (model)), factory); g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list); ``` -------------------------------- ### getMarginStart() Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WidgetProtocol.html Gets the start margin of the widget. ```APIDOC ## func getMarginStart() ### Description Gets the start margin of the widget. ### Signature `func getMarginStart() -> Int` ``` -------------------------------- ### Initialize PageSetup from KeyFile Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Reads page setup configuration from a specific group within a key file. ```Swift @inlinable public init(keyFile: KeyFileT, groupName: UnsafePointer? = nil) throws where KeyFileT : KeyFileProtocol ``` -------------------------------- ### Get Strength Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Retrieves the strength of the constraint guide. ```Swift @inlinable func getStrength() -> GtkConstraintStrength ``` -------------------------------- ### Handle Editing Started Signal Source: https://rhx.github.io/SwiftGtk4Doc/Enums/CellRendererSpinnerSignalName.html Example of setting up an editable widget when editing starts, ensuring the widget type is checked before modification. ```C static void text_editing_started (GtkCellRenderer *cell, GtkCellEditable *editable, const char *path, gpointer data) { if (GTK_IS_ENTRY (editable)) { GtkEntry *entry = GTK_ENTRY (editable); // ... create a GtkEntryCompletion gtk_entry_set_completion (entry, completion); } } ``` -------------------------------- ### Initialize PageSetup from KeyFile Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Creates a new PageSetup instance by reading from a specific group in a KeyFile. Throws an error if the operation fails. ```Swift @inlinable public static func newFrom(keyFile: KeyFileT, groupName: UnsafePointer? = nil) throws -> PageSetup! where KeyFileT : KeyFileProtocol ``` -------------------------------- ### getNatSize(width:height:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Gets the natural size of the guide. ```APIDOC ## getNatSize(width:height:) ### Description Gets the natural size of the guide. ### Signature `func getNatSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil)` ``` -------------------------------- ### init(raw:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WindowHandleClassProtocol.html Initializes a new instance conforming to WindowHandleClassProtocol. ```APIDOC ### Initializer `init(raw: UnsafeMutableRawPointer)` ### Description Required initializer for types conforming to WindowHandleClassProtocol. ``` -------------------------------- ### init(file:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Reads the page setup from a specified file. ```APIDOC ## init(file:) ### Description Reads the page setup from the file `file_name`. Returns a new GtkPageSetup object with the restored page setup, or throws an error if an error occurred. ### Parameters - **fileName** (UnsafePointer!) - Required - The path to the file to read. ### Declaration ```swift public init(file fileName: UnsafePointer!) throws ``` ``` -------------------------------- ### getMinSize(width:height:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Gets the minimum size of the guide. ```APIDOC ## getMinSize(width:height:) ### Description Gets the minimum size of the guide. ### Signature `func getMinSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil)` ``` -------------------------------- ### getMaxSize(width:height:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Gets the maximum size of the guide. ```APIDOC ## getMaxSize(width:height:) ### Description Gets the maximum size of the guide. ### Signature `func getMaxSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil)` ``` -------------------------------- ### Strength Property Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html A property to get or set the GtkConstraintStrength of the guide. ```Swift @inlinable var strength: GtkConstraintStrength { get nonmutating set } ``` -------------------------------- ### init(keyFile:groupName:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PageSetup.html Reads the page setup from a group in a key file. ```APIDOC ## init(keyFile:groupName:) ### Description Reads the page setup from the group `group_name` in the key file `key_file`. ### Parameters - **keyFile** (KeyFileT) - Required - The key file object. - **groupName** (UnsafePointer?) - Optional - The group name within the key file. ### Declaration ```swift public init(keyFile: KeyFileT, groupName: UnsafePointer? = nil) throws where KeyFileT : KeyFileProtocol ``` ``` -------------------------------- ### init(_:) Source: https://rhx.github.io/SwiftGtk4Doc/Extensions/License.html Initializes a License instance from a raw binary integer value. ```APIDOC ## init(_ raw: I) where I : BinaryInteger ### Description Cast constructor, converting any binary integer to a License. ### Parameters - **raw** (I) - Required - The raw integer value to initialise the enum from. ``` -------------------------------- ### Get Name Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Retrieves the name assigned to the constraint guide. ```Swift @inlinable func getName() -> String! ``` -------------------------------- ### Get buffer bounds Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextBufferProtocol.html Returns the start and end TextIter for the buffer. ```Swift @inlinable var bounds: (start: TextIter, end: TextIter) { get } ``` -------------------------------- ### init(application:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ApplicationWindow.html Creates a new GtkApplicationWindow instance associated with the provided application. ```APIDOC ## init(application:) ### Description Creates a new GtkApplicationWindow instance associated with the provided application object. ### Signature `public init(application: ApplicationT) where ApplicationT : ApplicationProtocol` ### Parameters - **application** (ApplicationT) - Required - An instance of an application that conforms to ApplicationProtocol. ``` -------------------------------- ### Initialize Gtk.PageSetupRef from file Source: https://rhx.github.io/SwiftGtk4Doc/Structs/PageSetupRef.html Initializes a page setup object by reading from a specified file path. ```Swift @inlinable init(file fileName: UnsafePointer!) throws ``` -------------------------------- ### Name Property Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html A property to get or set the name of the guide for debugging. ```Swift @inlinable var name: String! { get nonmutating set } ``` -------------------------------- ### init(keyFile:groupName:) Source: https://rhx.github.io/SwiftGtk4Doc/Structs/PrintSettingsRef.html Initializes a new PrintSettingsRef from a KeyFile. ```APIDOC ## init(keyFile:groupName:) ### Description Reads the print settings from the specified group in a key file. ### Signature `init(keyFile: KeyFileT, groupName: UnsafePointer? = nil) throws where KeyFileT : KeyFileProtocol` ``` -------------------------------- ### Get start iterator Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextBufferProtocol.html Initializes the provided iterator to the first position in the buffer. ```Swift @inlinable func getStart(iter: TextIterT) where TextIterT : TextIterProtocol ``` -------------------------------- ### init(min:max:step:icons:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ScaleButton.html Creates a new GtkScaleButton with a specified range and optional icons. ```APIDOC ## init(min:max:step:icons:) ### Description Creates a new GtkScaleButton. The new scale button has a range between min and max, with a stepping of step. ### Parameters - **min** (CDouble) - The minimum value of the scale. - **max** (CDouble) - The maximum value of the scale. - **step** (CDouble) - The stepping value. - **icons** (UnsafeMutablePointer?>!) - Optional list of icons for the button. ``` -------------------------------- ### Get Iterator at Line Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextBufferProtocol.html Initializes an iterator to the start of a specific line number. ```Swift @inlinable func getIterAtLine(iter: TextIterT, lineNumber: Int) -> Bool where TextIterT : TextIterProtocol ``` -------------------------------- ### init(title:action:acceptLabel:cancelLabel:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/FileChooserNative.html Convenience initializer to create a new, native file chooser. ```APIDOC ## init(title:action:acceptLabel:cancelLabel:) ### Description Convenience initializer to create a new, native file chooser. ### Parameters - **title** (UnsafePointer!) - Optional - Title of the native file chooser - **action** (FileChooserAction) - Required - File chooser kind, e.g. .open or .save - **acceptLabel** (UnsafePointer?) - Optional - Text of the accept button or nil for the default - **cancelLabel** (UnsafePointer?) - Optional - Text of the cancel button or nil for the default ### Declaration ```swift convenience init(title: UnsafePointer! = nil, action: FileChooserAction = .open, acceptLabel: UnsafePointer? = nil, cancelLabel: UnsafePointer? = nil) ``` ``` -------------------------------- ### Get Line Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextIterProtocol.html Returns the line number containing the iterator, starting from 0. ```Swift @inlinable func getLine() -> Int ``` -------------------------------- ### init(_:) Source: https://rhx.github.io/SwiftGtk4Doc/Extensions/InputPurpose.html Initializes a new InputPurpose instance from a raw binary integer value. ```APIDOC ## init(_ raw: I) ### Description Cast constructor, converting any binary integer to a `InputPurpose`. ### Declaration `init!(_ raw: I) where I : BinaryInteger` ### Parameters - **raw** (BinaryInteger) - Required - The raw integer value to initialise the enum from. ``` -------------------------------- ### Get ColumnView sorter Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ColumnViewProtocol.html Retrieves the sorter for the ColumnView, with an example of setting up sorting. ```Swift @inlinable func getSorter() -> SorterRef! ``` ```C gtk_column_view_column_set_sorter (column, sorter); gtk_column_view_append_column (view, column); sorter = g_object_ref (gtk_column_view_get_sorter (view))); model = gtk_sort_list_model_new (store, sorter); selection = gtk_no_selection_new (model); gtk_column_view_set_model (view, selection); ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Entry.html Creates a new entry instance. ```APIDOC ## init() ### Description Creates a new entry. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Get Line Offset Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextIterProtocol.html Returns the character offset of the iterator from the start of a newline-terminated line. ```Swift @inlinable func getLineOffset() -> Int ``` -------------------------------- ### Get Selection Bounds Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/EditableProtocol.html Retrieves the start and end positions of the current text selection. ```Swift @inlinable func getSelectionBounds(startPos: UnsafeMutablePointer! = nil, endPos: UnsafeMutablePointer! = nil) -> Bool ``` -------------------------------- ### Create a basic Hello World application with SwiftGtk Source: https://rhx.github.io/SwiftGtk Initializes a GTK application window with a label. Requires the Gtk module. ```swift import Gtk let status = Application.run { let window = ApplicationWindowRef(application: $0) window.title = "Hello, world" window.setDefaultSize(width: 320, height: 240) let label = LabelRef(str: "Hello, SwiftGtk") window.add(widget: label) window.showAll() } ``` -------------------------------- ### Get Top Margin Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PageSetupProtocol.html Retrieves the top margin of the page setup in the specified unit. ```Swift @inlinable func getTopMargin(unit: GtkUnit) -> CDouble ``` -------------------------------- ### Implement GtkInfoBar in C Source: https://rhx.github.io/SwiftGtk4Doc/Classes/InfoBar.html Example demonstrating the creation, configuration, and display of a GtkInfoBar widget. ```c GtkWidget *message_label; GtkWidget *widget; GtkWidget *grid; GtkInfoBar *bar; // set up info bar widget = gtk_info_bar_new (); bar = GTK_INFO_BAR (widget); grid = gtk_grid_new (); message_label = gtk_label_new (""); gtk_info_bar_add_child (bar, message_label); gtk_info_bar_add_button (bar, `_("_OK")`, GTK_RESPONSE_OK); g_signal_connect (bar, "response", G_CALLBACK (gtk_widget_hide), NULL); gtk_grid_attach (GTK_GRID (grid), widget, 0, 2, 1, 1); // ... // show an error message gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!"); gtk_info_bar_set_message_type (bar, GTK_MESSAGE_ERROR); gtk_widget_show (bar); ``` -------------------------------- ### Get iterator at offset Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextBufferProtocol.html Initializes the iterator to a position at the specified character offset from the start of the buffer. ```Swift @inlinable func getIterAtOffset(iter: TextIterT, charOffset: Int) where TextIterT : TextIterProtocol ``` -------------------------------- ### Run Asynchronous Page Setup Dialog Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintSettingsProtocol.html Methods to initiate a page setup dialog asynchronously, allowing user interaction without blocking the main thread. ```Swift @inlinable func printRunPageSetupDialogAsync(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) ``` ```Swift @inlinable func printRunPageSetupDialogAsync(parent: WindowT?, pageSetup: PageSetupT?, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, WindowT : WindowProtocol ``` -------------------------------- ### Access Page Range Boundaries Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PageRangeProtocol.html Properties to get or set the start and end of the page range. ```Swift @inlinable var start: gint { get set } ``` ```Swift @inlinable var end: gint { get set } ``` -------------------------------- ### Create and Populate a ListStore in C Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ListStore.html Demonstrates initializing a GtkListStore with specific column types and populating it with rows using gtk_list_store_append and gtk_list_store_set. ```c enum { COLUMN_STRING, COLUMN_INT, COLUMN_BOOLEAN, N_COLUMNS }; { GtkListStore *list_store; GtkTreePath *path; GtkTreeIter iter; int i; list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN); for (i = 0; i < 10; i++) { char *some_data; some_data = get_some_data (i); // Add a new row to the model gtk_list_store_append (list_store, &iter); gtk_list_store_set (list_store, &iter, COLUMN_STRING, some_data, COLUMN_INT, i, COLUMN_BOOLEAN, FALSE, -1); // As the store will keep a copy of the string internally, // we free some_data. g_free (some_data); } // Modify a particular row path = gtk_tree_path_new_from_string ("4"); gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), &iter, path); gtk_tree_path_free (path); gtk_list_store_set (list_store, &iter, COLUMN_BOOLEAN, TRUE, -1); } ``` -------------------------------- ### init(_:) Source: https://rhx.github.io/SwiftGtk4Doc/Extensions/ShortcutScope.html Initializes a ShortcutScope from a binary integer value. ```APIDOC ## init(_ raw: I) ### Description Initializes a new `ShortcutScope` instance from a provided binary integer value. ### Parameters - **raw** (BinaryInteger) - Required - The raw integer value to initialize the enum from. ``` -------------------------------- ### Get selection bounds Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextBufferProtocol.html Returns true if text is selected and populates the provided start and end iterators. ```Swift @inlinable func getSelectionBounds(start: TextIterT, end: TextIterT) -> Bool where TextIterT : TextIterProtocol ``` -------------------------------- ### init(raw:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/MediaControlsClassProtocol.html Initializes a new instance conforming to MediaControlsClassProtocol using a raw pointer. ```APIDOC ## init(raw:) ### Description Required initializer for types conforming to MediaControlsClassProtocol. ### Parameters - **raw** (UnsafeMutableRawPointer) - The raw pointer to the underlying instance. ### Declaration ```swift init(raw: UnsafeMutableRawPointer) ``` ``` -------------------------------- ### Get Visible Line Offset Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextIterProtocol.html Returns the character offset from the start of the line, excluding invisible characters. ```Swift @inlinable func getVisibleLineOffset() -> Int ``` -------------------------------- ### Show URI Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WindowProtocol.html Launches the default application for a given URI. ```Swift @inlinable func show(uri: UnsafePointer!, timestamp: guint32) ``` -------------------------------- ### Get Visible Line Index Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TextIterProtocol.html Returns the byte count from the start of the line, excluding invisible characters. ```Swift @inlinable func getVisibleLineIndex() -> Int ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/CenterBox.html Creates a new GtkCenterBox instance. ```APIDOC ## init() ### Description Creates a new GtkCenterBox instance. ### Declaration ```swift public init() ``` ``` -------------------------------- ### init(resource:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Picture.html Creates a new GtkPicture displaying the resource at the given path. ```APIDOC ## init(resource:) ### Description Creates a new GtkPicture displaying the resource at resource_path. ``` -------------------------------- ### Get Drag Start Point in Swift Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/GestureDragProtocol.html Retrieves the surface-relative coordinates where the drag gesture originated if active. ```Swift @inlinable func getStartPoint(x: UnsafeMutablePointer?, y: UnsafeMutablePointer?) -> Bool ``` -------------------------------- ### Get or set cursor position Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/EditableProtocol.html Manages the current cursor position in characters relative to the start of the content. ```Swift @inlinable var position: Int { get nonmutating set } ``` -------------------------------- ### Create and configure a LevelBar Source: https://rhx.github.io/SwiftGtk4Doc/Classes/LevelBar.html Demonstrates initializing a LevelBar and adding custom offsets for state management. ```c static GtkWidget * create_level_bar (void) { GtkWidget *widget; GtkLevelBar *bar; widget = gtk_level_bar_new (); bar = GTK_LEVEL_BAR (widget); // This changes the value of the default low offset gtk_level_bar_add_offset_value (bar, GTK_LEVEL_BAR_OFFSET_LOW, 0.10); // This adds a new offset to the bar; the application will // be able to change its color CSS like this: // // levelbar block.my-offset { // background-color: magenta; // border-style: solid; // border-color: black; // border-style: 1px; // } gtk_level_bar_add_offset_value (bar, "my-offset", 0.60); return widget; } ``` -------------------------------- ### Get Natural Size Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Retrieves the natural size of the guide using optional pointers for width and height. ```Swift @inlinable func getNatSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil) ``` -------------------------------- ### Setup a column view with a tree model Source: https://rhx.github.io/SwiftGtk4Doc/Classes/TreeListRowSorter.html Demonstrates initializing a sorter and applying it to a sort list model for a column view. ```C column_sorter = gtk_column_view_get_sorter (view); sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter)); sort_model = gtk_sort_list_model_new (tree_model, sorter); selection = gtk_single_selection_new (sort_model); gtk_column_view_set_model (view, G_LIST_MODEL (selection)); ``` -------------------------------- ### Get Minimum Size Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Retrieves the minimum size of the guide using optional pointers for width and height. ```Swift @inlinable func getMinSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil) ``` -------------------------------- ### Get Maximum Size Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintGuideProtocol.html Retrieves the maximum size of the guide using optional pointers for width and height. ```Swift @inlinable func getMaxSize(width: UnsafeMutablePointer? = nil, height: UnsafeMutablePointer? = nil) ``` -------------------------------- ### Get Drag Offset in Swift Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/GestureDragProtocol.html Retrieves the current drag offset relative to the starting point if the gesture is active. ```Swift @inlinable func getOffset(x: UnsafeMutablePointer?, y: UnsafeMutablePointer?) -> Bool ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/VolumeButton.html Creates a new GtkVolumeButton instance with a default range of 0.0 to 1.0 and a stepping of 0.02. ```APIDOC ## init() ### Description Creates a new GtkVolumeButton instance. The button defaults to a range between 0.0 and 1.0 with a stepping of 0.02. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Build and test SwiftGtk via command line Source: https://rhx.github.io/SwiftGtk4Doc/index.html Standard procedure for cloning and building the project from the command line. ```bash git clone https://github.com/rhx/SwiftGtk.git cd SwiftGtk ./run-gir2swift.sh swift build swift test ``` -------------------------------- ### set(autoplay:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/VideoProtocol.html Sets whether self automatically starts playback when it becomes visible or when a new file gets loaded. ```APIDOC ## func set(autoplay: Bool) ### Description Sets whether self automatically starts playback when it becomes visible or when a new file gets loaded. ### Parameters - **autoplay** (Bool) - Required - Whether to enable autoplay. ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Switch.html Creates a new GtkSwitch widget. ```APIDOC ## init() ### Description Creates a new GtkSwitch widget. ### Signature `public init()` ``` -------------------------------- ### Get Visible Range Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/IconViewProtocol.html Sets start and end paths to the first and last visible paths; paths must be freed after use. ```Swift @inlinable func getVisibleRange(startPath: UnsafeMutablePointer?>! = nil, endPath: UnsafeMutablePointer?>! = nil) -> Bool ``` -------------------------------- ### Run Application with Startup and Activation Handlers Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Application.html Initializes and runs an application with support for both startup and activation signal handlers. ```Swift @inlinable static func run(id name: UnsafePointer? = nil, flags f: ApplicationFlags = .none, arguments args: [String]? = nil, startupHandler s: ApplicationSignalHandler?, activationHandler a: ApplicationSignalHandler?) -> Int? ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/IMContextSimple.html Creates a new instance of GtkIMContextSimple. ```APIDOC ## init() ### Description Creates a new GtkIMContextSimple instance. ### Declaration ```swift public init() ``` ``` -------------------------------- ### Get Selected Rows Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TreeSelectionProtocol.html Creates a list of paths for all selected rows. Use the provided C example to free the returned list. ```C g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); ``` ```Swift @inlinable func getSelectedRows(model: UnsafeMutablePointer?>! = nil) -> GLib.ListRef! ``` -------------------------------- ### init(_:) Source: https://rhx.github.io/SwiftGtk4Doc/Extensions/ShortcutType.html Initializes a ShortcutType from a raw binary integer value. ```APIDOC ## init(_ raw: I) where I : BinaryInteger ### Description Initializes the ShortcutType enum from a raw binary integer value. ### Parameters - **raw** (BinaryInteger) - The raw integer value to initialize the enum from. ``` -------------------------------- ### ready Source: https://rhx.github.io/SwiftGtk4Doc/Enums/PrintOperationPreviewSignalName.html The ready signal gets emitted once per preview operation, before the first page is rendered. A handler for this signal can be used for setup tasks. ```APIDOC ### ready The `ready` signal gets emitted once per preview operation, before the first page is rendered. A handler for this signal can be used for setup tasks. #### Declaration ```swift case ready = "ready" ``` ``` -------------------------------- ### init(file:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Builder.html Parses the UI definition from a file. ```APIDOC ## init(file:) ### Description Parses the UI definition in the specified file. The program will abort if there is an error opening or parsing the file. ### Declaration ```swift public init(file filename: UnsafePointer!) ``` ``` -------------------------------- ### Get Direction Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WidgetProtocol.html Gets the reading direction for the widget. ```Swift @inlinable func getDirection() -> GtkTextDirection ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/WindowHandle.html Creates a new GtkWindowHandle instance. ```APIDOC ## init() ### Description Creates a new GtkWindowHandle. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Snapshot.html Creates a new GtkSnapshot instance. ```APIDOC ## init() ### Description Creates a new GtkSnapshot instance. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Get Tabs Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/EntryProtocol.html Gets the tabstops defined for the entry. ```Swift @inlinable func getTabs() -> Pango.TabArrayRef! ``` -------------------------------- ### init(file:) Source: https://rhx.github.io/SwiftGtk4Doc/Structs/PrintSettingsRef.html Initializes a new PrintSettingsRef from a file path. ```APIDOC ## init(file:) ### Description Initializes a new PrintSettingsRef object by reading settings from the specified file. ### Signature `init(file fileName: UnsafePointer!) throws` ``` -------------------------------- ### Start Widget Property Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/CenterBoxProtocol.html Property access for the start widget. ```Swift @inlinable var startWidget: WidgetRef! { get nonmutating set } ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Stack.html Creates a new GtkStack instance. ```APIDOC ## init() ### Description Creates a new GtkStack instance. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Set Start Widget Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/CenterBoxProtocol.html Sets or removes the start widget. ```Swift @inlinable func setStartWidget(child: WidgetRef? = nil) ``` ```Swift @inlinable func setStartWidget(child: WidgetT?) where WidgetT : WidgetProtocol ``` -------------------------------- ### Get Font Map Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/WidgetProtocol.html Gets the font map of the widget. ```Swift @inlinable func getFontMap() -> Pango.FontMapRef! ``` -------------------------------- ### Run an Application Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Application.html Initializes and executes the application, intended to be called from main(). ```Swift @inlinable func run(arguments: [String]? = nil, activationHandler: ApplicationSignalHandler? = nil) -> Int ``` -------------------------------- ### Get Selection Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TreeViewProtocol.html Gets the GtkTreeSelection associated with the tree view. ```Swift @inlinable func getSelection() -> TreeSelectionRef! ``` -------------------------------- ### init(string:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/ShortcutAction.html Initializes a new ShortcutAction by parsing a provided string representation. ```APIDOC ## init(string:) ### Description Tries to parse the given string into an action. Accepted strings include 'nothing', 'activate', 'mnemonic-activate', 'action(NAME)', and 'signal(NAME)'. ### Parameters - **string** (UnsafePointer!) - Required - The string representation of the action to parse. ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/BinLayout.html Creates a new GtkBinLayout instance. ```APIDOC ## init() ### Description Creates a new GtkBinLayout instance. ### Declaration ```swift public init() ``` ``` -------------------------------- ### Get Range Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/SpinButtonProtocol.html Gets the range allowed for the spin button. ```Swift @inlinable func getRange(min: UnsafeMutablePointer! = nil, max: UnsafeMutablePointer! = nil) ``` -------------------------------- ### Get page title Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/AssistantProtocol.html Gets the title for the specified page. ```Swift @inlinable func getPageTitle(page: WidgetT) -> String! where WidgetT : WidgetProtocol ``` -------------------------------- ### init(file:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Picture.html Creates a new GtkPicture displaying the given file. ```APIDOC ## init(file:) ### Description Creates a new GtkPicture displaying the given file. If the file isn't found or can't be loaded, the resulting GtkPicture is empty. ``` -------------------------------- ### init(action:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/FileChooserWidget.html Creates a new GtkFileChooserWidget instance with the specified action. ```APIDOC ## init(action: GtkFileChooserAction) ### Description Creates a new GtkFileChooserWidget. This is a file chooser widget that can be embedded in custom windows, and it is the same widget that is used by GtkFileChooserDialog. ### Parameters - **action** (GtkFileChooserAction) - Required - The action to be performed by the file chooser widget. ``` -------------------------------- ### Unicode Entry Example Source: https://rhx.github.io/SwiftGtk4Doc/Classes/IMContextSimple.html Example of typing a Unicode codepoint. ```text Ctrl-Shift-u 1 2 3 Enter ``` -------------------------------- ### remove(guide:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintLayoutProtocol.html Removes a specific guide from the layout manager. ```APIDOC ## remove(guide:) ### Description Removes the specified guide from the layout manager, so that it no longer influences the layout. ### Declaration ```swift @inlinable func remove(guide: ConstraintGuideT) where ConstraintGuideT : ConstraintGuideProtocol ``` ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/StackSwitcher.html Creates a new instance of GtkStackSwitcher. ```APIDOC ## init() ### Description Create a new `GtkStackSwitcher` instance. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### init(model:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/PopoverMenu.html Creates a GtkPopoverMenu and populates it according to the provided model, creating menus with sliding submenus. ```APIDOC ## init(model:) ### Description Creates a GtkPopoverMenu and populates it according to model. The created buttons are connected to actions found in the GtkApplicationWindow to which the popover belongs. ### Parameters - **model** (MenuModelT?) - Required - The menu model to populate the popover. ``` -------------------------------- ### add(guide:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/ConstraintLayoutProtocol.html Adds a layout guide to the layout manager. ```APIDOC ## func add(guide: ConstraintGuideT) ### Description Adds a non-visible guide that can be used as a source or target for constraints. The layout manager takes ownership of the guide. ``` -------------------------------- ### init() Source: https://rhx.github.io/SwiftGtk4Doc/Classes/InfoBar.html Creates a new GtkInfoBar object. ```APIDOC ## init() ### Description Creates a new GtkInfoBar object. ### Declaration ```swift @inlinable public init() ``` ``` -------------------------------- ### Start Child Property Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PanedProtocol.html Property to retrieve or set the start child. ```Swift @inlinable var startChild: WidgetRef! { get nonmutating set } ``` -------------------------------- ### run(arguments:startupHandler:activationHandler:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Application.html Starts the application execution loop. This method is intended to be called from the main() function. ```APIDOC ## run(arguments:startupHandler:activationHandler:) ### Description Runs the application. This function handles command-line arguments and manages the application lifecycle, including signal emission for startup and activation. ### Signature `run(arguments:startupHandler:activationHandler:)` ### Parameters - **arguments** (Array) - Optional - Command-line arguments passed to the application. - **startupHandler** (Closure) - Optional - Handler for the startup signal. - **activationHandler** (Closure) - Optional - Handler for the activation signal. ``` -------------------------------- ### Get Search Column Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TreeViewProtocol.html Gets the column used for interactive searching. ```Swift @inlinable func getSearchColumn() -> Int ``` -------------------------------- ### Get sort indicator state Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/TreeViewColumnProtocol.html Gets the value set by gtk_tree_view_column_set_sort_indicator(). ```Swift @inlinable func getSortIndicator() -> Bool ``` -------------------------------- ### init(raw:) Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/BuilderProtocol.html Initializes a new instance conforming to BuilderProtocol with a raw pointer. ```APIDOC ## init(raw: UnsafeMutableRawPointer) ### Description Required initializer for types conforming to BuilderProtocol. ### Parameters - **raw** (UnsafeMutableRawPointer) - Required - The raw pointer to the GtkBuilder instance. ### Declaration ```swift init(raw: UnsafeMutableRawPointer) ``` ``` -------------------------------- ### Get Update Policy Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/SpinButtonProtocol.html Gets the update behavior of a spin button. ```Swift @inlinable func getUpdatePolicy() -> GtkSpinButtonUpdatePolicy ``` -------------------------------- ### init(title:parent:action:acceptLabel:cancelLabel:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/FileChooserNative.html Convenience initializer to create a new, native file chooser with a parent window. ```APIDOC ## init(title:parent:action:acceptLabel:cancelLabel:) ### Description Convenience initializer to create a new, native file chooser with a parent window. ### Parameters - **title** (UnsafePointer!) - Optional - Title of the native file chooser - **parent** (W) - Required - Parent window - **action** (FileChooserAction) - Required - File chooser kind, e.g. .open or .save - **acceptLabel** (UnsafePointer?) - Optional - Text of the accept button or nil for the default - **cancelLabel** (UnsafePointer?) - Optional - Text of the cancel button or nil for the default ### Declaration ```swift convenience init(title: UnsafePointer! = nil, parent: W, action: FileChooserAction = .open, acceptLabel: UnsafePointer? = nil, cancelLabel: UnsafePointer? = nil) where W : WindowProtocol ``` ``` -------------------------------- ### Standard Swift build commands Source: https://rhx.github.io/SwiftGtk4Doc/index.html Use standard Swift commands to build, test, or run the project after generating wrappers. ```bash swift build swift test swift run ``` -------------------------------- ### Get Path at Position Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/IconViewProtocol.html Gets the path for the icon at the given position. ```Swift @inlinable func getPathAtPos(x: Int, y: Int) -> TreePathRef! ``` -------------------------------- ### Get Wide Handle Method Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PanedProtocol.html Gets whether the separator should be wide. ```Swift @inlinable func getWideHandle() -> Bool ``` -------------------------------- ### init(resource:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Builder.html Parses the UI definition from a resource path. ```APIDOC ## init(resource:) ### Description Parses the UI definition at the specified resource path. The program will abort if there is an error locating or parsing the resource. ### Declaration ```swift public init(resource: UnsafePointer!) ``` ``` -------------------------------- ### Get Tab Position Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/NotebookProtocol.html Gets the edge where the tabs are currently drawn. ```Swift @inlinable func getTabPos() -> GtkPositionType ``` -------------------------------- ### Get page type Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/AssistantProtocol.html Gets the page type of the specified page. ```Swift @inlinable func getPageType(page: WidgetT) -> GtkAssistantPageType where WidgetT : WidgetProtocol ``` -------------------------------- ### init(_:) Source: https://rhx.github.io/SwiftGtk4Doc/Extensions/Orientation.html Initializes a new Orientation instance from a binary integer value. ```APIDOC ## init(_ raw: I) ### Description Cast constructor, converting any binary integer to an Orientation. ### Parameters - **raw** (BinaryInteger) - Required - The raw integer value to initialise the enum from. ``` -------------------------------- ### init(orientation:spacing:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Box.html Creates a new GtkBox instance with the specified orientation and spacing. ```APIDOC ## init(orientation:spacing:) ### Description Creates a new GtkBox instance with the specified orientation and spacing. ### Signature `public init(orientation: GtkOrientation, spacing: Int)` ### Parameters - **orientation** (GtkOrientation) - The orientation of the box. - **spacing** (Int) - The number of pixels to place between children. ``` -------------------------------- ### Dead Key Example Source: https://rhx.github.io/SwiftGtk4Doc/Classes/IMContextSimple.html Example of using a dead key sequence. ```text dead_acute a ``` -------------------------------- ### Page Setup Property Source: https://rhx.github.io/SwiftGtk4Doc/Protocols/PrintUnixDialogProtocol.html Accesses the page setup used by the dialog. ```Swift @inlinable var pageSetup: PageSetupRef! { get nonmutating set } ``` -------------------------------- ### init(filename:) Source: https://rhx.github.io/SwiftGtk4Doc/Classes/Picture.html Creates a new GtkPicture displaying the file specified by the filename. ```APIDOC ## init(filename:) ### Description Creates a new GtkPicture displaying the file filename. This is a utility function. ```