ToolButtonRef

public struct ToolButtonRef : ToolButtonProtocol, GWeakCapturing

GtkToolButtons are GtkToolItems containing buttons.

Use gtk_tool_button_new() to create a new GtkToolButton.

The label of a GtkToolButton is determined by the properties GtkToolButton:label-widget, GtkToolButton:label, and GtkToolButton:stock-id. If GtkToolButton:label-widget is non-nil, then that widget is used as the label. Otherwise, if GtkToolButton:label is non-nil, that string is used as the label. Otherwise, if GtkToolButton:stock-id is non-nil, the label is determined by the stock item. Otherwise, the button does not have a label.

The icon of a GtkToolButton is determined by the properties GtkToolButton:icon-widget and GtkToolButton:stock-id. If GtkToolButton:icon-widget is non-nil, then that widget is used as the icon. Otherwise, if GtkToolButton:stock-id is non-nil, the icon is determined by the stock item. Otherwise, the button does not have a icon.

CSS nodes

GtkToolButton has a single CSS node with name toolbutton.

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

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

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

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

ToolButton Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkToolButton>?)
  • 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 ToolButtonProtocol

    Declaration

    Swift

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

    Declaration

    Swift

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

    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 ToolButtonProtocol.

    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 ToolButtonProtocol.

    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 ToolButtonProtocol.

    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 ToolButtonProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new `GtkToolButton` using `icon_widget` as contents and `label` as
    

    label.

    Declaration

    Swift

    @inlinable
    init<WidgetT>(iconWidget: WidgetT?, label: UnsafePointer<gchar>? = nil) where WidgetT : WidgetProtocol
  • Creates a new GtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK and GTK_STOCK_APPLY.

    It is an error if stock_id is not a name of a stock item.

    new_from_stock is deprecated: Use gtk_tool_button_new() together with gtk_image_new_from_icon_name() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    init(stock stockID: UnsafePointer<gchar>!)
  • Creates a new GtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK and GTK_STOCK_APPLY.

    It is an error if stock_id is not a name of a stock item.

    new_from_stock is deprecated: Use gtk_tool_button_new() together with gtk_image_new_from_icon_name() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    static func newFrom(stock stockID: UnsafePointer<gchar>!) -> ToolItemRef!