Next: <GdkToplevel>, Previous: <GdkPaintable>, Up: Interfaces   [Index]


2.4 <GdkPopup> ¶

Interface: <GdkPopup> ¶

A surface that is attached to another surface.

The <GdkPopup> is positioned relative to its parent surface.

<GdkPopup>s are typically used to implement menus and similar popups. They can be modal, which is indicated by the popup:autohide property.

Properties ¶

Property: popup:autohide self ¶

Whether to hide on outside clicks.

Its value is a boolean.

It can only be set when the object is made, with #:autohide.

Property: popup:parent self ¶

The parent surface.

Its value is a <GdkSurface>, or #f.

It can only be set when the object is made, with #:parent.

Procedures ¶

Method: popup:get-autohide? self ⇒ %return ¶
Method: get-autohide? self ⇒ %return ¶

Returns whether this popup is set to hide on outside clicks.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a boolean.

#t if self will autohide

Method: popup:get-parent self ⇒ %return ¶
Method: get-parent self ⇒ %return ¶

Returns the parent surface of a popup.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a <GdkSurface>, or #f.

the parent surface

Method: popup:get-position-x self ⇒ %return ¶
Method: get-position-x self ⇒ %return ¶

Obtains the position of the popup relative to its parent.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a 32-bit integer.

the X coordinate of self position

Method: popup:get-position-y self ⇒ %return ¶
Method: get-position-y self ⇒ %return ¶

Obtains the position of the popup relative to its parent.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a 32-bit integer.

the Y coordinate of self position

Method: popup:get-rect-anchor self ⇒ %return ¶
Method: get-rect-anchor self ⇒ %return ¶

Gets the current popup rectangle anchor.

The value returned may change after calling popup:present?, or after the surface:layout signal is emitted.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a <GdkGravity>.

the current rectangle anchor value of self

Method: popup:get-surface-anchor self ⇒ %return ¶
Method: get-surface-anchor self ⇒ %return ¶

Gets the current popup surface anchor.

The value returned may change after calling popup:present?, or after the surface:layout signal is emitted.

self

Passed: a <GdkPopup>.

a <GdkPopup>

%return

Returned: a <GdkGravity>.

the current surface anchor value of self

Method: popup:present? self width height layout ⇒ %return ¶
Method: present? self width height layout ⇒ %return ¶

Present self after having processed the <GdkPopupLayout> rules.

If the popup was previously not showing, it will be shown, otherwise it will change position according to layout.

After calling this function, the result should be handled in response to the surface:layout signal being emitted. The resulting popup position can be queried using popup:get-position-x, popup:get-position-y, and the resulting size will be sent as parameters in the layout signal. Use popup:get-rect-anchor and popup:get-surface-anchor to get the resulting anchors.

Presenting may fail, for example if the self is set to autohide and is immediately hidden upon being presented. If presenting failed, the surface:layout signal will not me emitted.

self

Passed: a <GdkPopup>.

the <GdkPopup> to show

width

Passed: a 32-bit integer.

the unconstrained popup width to layout

height

Passed: a 32-bit integer.

the unconstrained popup height to layout

layout

Passed: a <GdkPopupLayout>.

the <GdkPopupLayout> object used to layout

%return

Returned: a boolean.

#f if it failed to be presented, otherwise #t.


Next: <GdkToplevel>, Previous: <GdkPaintable>, Up: Interfaces   [Index]