Package: gtk

Function gtk:label-layout-offsets

Lambda List

gtk:label-layout-offsets (label)

Syntax

(gtk:label-layout-offsets label) => x, y

Arguments

label -- a gtk:label widget
x -- an integer for the x offset
y -- an integer for the y offset

Details

Obtains the coordinates where the label will draw the pango:layout object representing the text in the label. This is useful to convert mouse events into coordinates inside the pango:layout object, for example, to take some action if some part of the label is clicked. Remember when using the pango:layout functions you need to convert to and from pixels using the pango:pixels function or the pango:+scale+ constant.

Examples

(gtk:label-layout-offsets (gtk:label-new))
=> 0
=> -9
(gtk:label-layout-offsets (gtk:label-new "text"))
=> -14
=> -9    
 

See also

2025-4-27