AboutDialogRef

public struct AboutDialogRef : AboutDialogProtocol, GWeakCapturing

The GtkAboutDialog offers a simple way to display information about a program.

The shown information includes the programs’ logo, name, copyright, website and license. It is also possible to give credits to the authors, documenters, translators and artists who have worked on the program.

An about dialog is typically opened when the user selects the About option from the Help menu. All parts of the dialog are optional.

An example GtkAboutDialog

About dialogs often contain links and email addresses. GtkAboutDialog displays these as clickable links. By default, it calls [funcGtk.show_uri] when a user clicks one. The behaviour can be overridden with the [signalGtk.AboutDialog::activate-link] signal.

To specify a person with an email address, use a string like Edgar Allan Poe <edgarpoe.com>. To specify a website with a title, use a string like GTK team https://www.gtk.org.

To make constructing a GtkAboutDialog as convenient as possible, you can use the function [funcGtk.show_about_dialog] which constructs and shows a dialog and keeps it around so that it can be shown again.

Note that GTK sets a default title of _("About %s") on the dialog window (where s is replaced by the name of the application, but in order to ensure proper translation of the title, applications should set the title property explicitly when constructing a GtkAboutDialog, as shown in the following example:

GFile *logo_file = g_file_new_for_path ("./logo.png");
GdkTexture *example_logo = gdk_texture_new_from_file (logo_file, NULL);
g_object_unref (logo_file);

gtk_show_about_dialog (NULL,
                       "program-name", "ExampleCode",
                       "logo", example_logo,
                       "title", `_("About ExampleCode")`,
                       NULL);

CSS nodes

GtkAboutDialog has a single CSS node with the name window and style class .aboutdialog.

The AboutDialogRef type acts as a lightweight Swift reference to an underlying GtkAboutDialog instance. It exposes methods that can operate on this data type through AboutDialogProtocol conformance. Use AboutDialogRef only as an unowned reference to an existing GtkAboutDialog instance.

  • ptr
    Untyped pointer to the underlying `GtkAboutDialog` instance.
    

    For type-safe access, use the generated, typed pointer about_dialog_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

AboutDialog Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkAboutDialog>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkAboutDialog>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkAboutDialog>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkAboutDialog>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements AboutDialogProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : AboutDialogProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> AboutDialogRef where T : AboutDialogProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to AboutDialogProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to AboutDialogProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to AboutDialogProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to AboutDialogProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to AboutDialogProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new GtkAboutDialog.

    Declaration

    Swift

    @inlinable
    init()