GdkPopupLayout struct contains information that is
necessary position a
Gdk#Popup relative to its parent.
The positioning requires a negotiation with the windowing system, since it depends on external constraints, such as the position of the parent surface, and the screen dimensions.
The basic ingredients are a rectangle on the parent surface, and the anchor on both that rectangle and the popup. The anchors specify a side or corner to place next to each other.
For cases where placing the anchors next to each other would make the popup extend offscreen, the layout includes some hints for how to resolve this problem. The hints may suggest to flip the anchor position to the other side, or to 'slide' the popup along a side, or to resize it.
These hints may be combined.
Ultimatively, it is up to the windowing system to determine the position
and size of the popup. You can learn about the result by calling
after the popup has been presented. This can be used to adjust the rendering.
Gtk#Popover changes its arrow position accordingly.
But you have to be careful avoid changing the size of the popover, or it
has to be presented again.
- .new(anchor_rect : Gdk::Rectangle, rect_anchor : Gdk::Gravity, surface_anchor : Gdk::Gravity) : self
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
#==(other : self) : Bool
trueif this reference is the same as other.
- #anchor_hints : Gdk::AnchorHints
- #anchor_hints=(anchor_hints : Gdk::AnchorHints) : Nil
- #anchor_rect : Gdk::Rectangle
- #anchor_rect=(anchor_rect : Gdk::Rectangle) : Nil
- #copy : Gdk::PopupLayout
- #equal(other : Gdk::PopupLayout) : Bool
- #offset(dx : Int32, dy : Int32) : Nil
- #rect_anchor : Gdk::Gravity
- #rect_anchor=(anchor : Gdk::Gravity) : Nil
- #ref : Gdk::PopupLayout
- #set_offset(dx : Int32, dy : Int32) : Nil
- #set_shadow_width(left : Int32, right : Int32, top : Int32, bottom : Int32) : Nil
- #shadow_width(left : Int32, right : Int32, top : Int32, bottom : Int32) : Nil
- #surface_anchor : Gdk::Gravity
- #surface_anchor=(anchor : Gdk::Gravity) : Nil
- #to_unsafe : Pointer(Void)
- #unref : Nil
true if this reference is the same as other. Invokes