PopupProtocol
public protocol PopupProtocol : SurfaceProtocol
The PopupProtocol protocol exposes the methods and properties of an underlying GdkPopup instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Popup.
Alternatively, use PopupRef as a lighweight, unowned reference if you already have an instance you just want to use.
A GdkPopup is a surface that is attached to another surface.
The GdkPopup is positioned relative to its parent surface.
GdkPopups are typically used to implement menus and similar popups.
They can be modal, which is indicated by the [propertyGdkPopup:autohide]
property.
-
Untyped pointer to the underlying
GdkPopupinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
popup_ptrDefault implementationTyped pointer to the underlying
GdkPopupinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkPopupinstance.Declaration
Swift
var popup_ptr: UnsafeMutablePointer<GdkPopup>! { get } -
Required Initialiser for types conforming to
PopupProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PopupPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PopupPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Popup property
Declaration
Swift
@inlinable func get(property: PopupPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a Popup property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PopupPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getAutohide()Extension methodReturns whether this popup is set to hide on outside clicks.
Declaration
Swift
@inlinable func getAutohide() -> Bool -
getParent()Extension methodReturns the parent surface of a popup.
Declaration
Swift
@inlinable func getParent() -> SurfaceRef! -
getPositionX()Extension methodObtains the position of the popup relative to its parent.
Declaration
Swift
@inlinable func getPositionX() -> Int -
getPositionY()Extension methodObtains the position of the popup relative to its parent.
Declaration
Swift
@inlinable func getPositionY() -> Int -
getRectAnchor()Extension methodGets the current popup rectangle anchor.
The value returned may change after calling [method
Gdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.Declaration
Swift
@inlinable func getRectAnchor() -> GdkGravity -
getSurfaceAnchor()Extension methodGets the current popup surface anchor.
The value returned may change after calling [method
Gdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.Declaration
Swift
@inlinable func getSurfaceAnchor() -> GdkGravity -
present(width:Extension methodheight: layout: ) Present
popupafter having processed theGdkPopupLayoutrules.If the popup was previously now showing, it will be showed, otherwise it will change position according to
layout.After calling this function, the result should be handled in response to the [signal
GdkSurface::layout] signal being emitted. The resulting popup position can be queried using [methodGdk.Popup.get_position_x], [methodGdk.Popup.get_position_y], and the resulting size will be sent as parameters in the layout signal. Use [methodGdk.Popup.get_rect_anchor] and [methodGdk.Popup.get_surface_anchor] to get the resulting anchors.Presenting may fail, for example if the
popupis set to autohide and is immediately hidden upon being presented. If presenting failed, the [signalGdk.Surface::layout] signal will not me emitted.Declaration
Swift
@inlinable func present<PopupLayoutT>(width: Int, height: Int, layout: PopupLayoutT) -> Bool where PopupLayoutT : PopupLayoutProtocol -
autohideExtension methodWhether to hide on outside clicks.
Declaration
Swift
@inlinable var autohide: Bool { get } -
parentExtension methodThe parent surface.
Declaration
Swift
@inlinable var parent: SurfaceRef! { get } -
positionXExtension methodObtains the position of the popup relative to its parent.
Declaration
Swift
@inlinable var positionX: Int { get } -
positionYExtension methodObtains the position of the popup relative to its parent.
Declaration
Swift
@inlinable var positionY: Int { get } -
rectAnchorExtension methodGets the current popup rectangle anchor.
The value returned may change after calling [method
Gdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.Declaration
Swift
@inlinable var rectAnchor: GdkGravity { get } -
surfaceAnchorExtension methodGets the current popup surface anchor.
The value returned may change after calling [method
Gdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.Declaration
Swift
@inlinable var surfaceAnchor: GdkGravity { get }
View on GitHub
Install in Dash
PopupProtocol Protocol Reference