| gtkWidgetGetAllocatedSize {RGtk} | R Documentation |
Returns the width and height allocated to a Gtk widget.
gtkWidgetGetAllocatedSize(w)
w |
the object of class "GtkWidget"
whose allocated dimensions are to be queried. |
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 |
Luca Di Gaspero <l.digaspero@uniud.it>
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()