gtkWidgetGetAllocatedSize {RGtk}R Documentation

Obtain dimensions allocated to a Gtk widget

Description

Returns the width and height allocated to a Gtk widget.

Usage

gtkWidgetGetAllocatedSize(w)

Arguments

w the object of class "GtkWidget" whose allocated dimensions are to be queried.

Value

An integer vector with two elements:

width the number of pixels the widget spans in the horizontal dimension
height the number of pixels the widget spans in the vertical dimension

Note

Author(s)

Luca Di Gaspero <l.digaspero@uniud.it>

References

See Also

Examples

library(RGtk)
win = gtkWindow(show = FALSE)
box = gtkVBox(spacing = 10)
win$Add(box)
button = gtkButton("Press me to see my current size")
button$AddCallback("pressed", function(w, ev) {
    print(gtkWidgetGetAllocatedSize(w))
  })
box$PackStart(button, expand = TRUE)
win$Show()

[Package RGtk version 0.7-0 Index]