Method

GtkLabelget_layout_offsets

Declaration [src]

void
gtk_label_get_layout_offsets (
  GtkLabel* label,
  gint* x,
  gint* y
)

Description [src]

Obtains the coordinates where the label will draw the PangoLayout representing the text in the label; useful to convert mouse events into coordinates inside the PangoLayout, e.g. to take some action if some part of the label is clicked. Of course you will need to create a GtkEventBox to receive the events, and pack the label inside it, since labels are windowless (they return FALSE from gtk_widget_get_has_window()). Remember when using the PangoLayout functions you need to convert to and from pixels using PANGO_PIXELS() or #PANGO_SCALE.

Parameters

x

Type: gint*

Location to store X offset of layout, or NULL.

The argument will be set by the function.
The argument can be NULL.
y

Type: gint*

Location to store Y offset of layout, or NULL.

The argument will be set by the function.
The argument can be NULL.