1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| case GeometryIdx:
{
char buffer[128];
GtkWidget *widget;
GtkRequisition req;
gint x, y, w, h;
widget = gnoclGetWidgetFromName ( Tcl_GetString ( objv[2] ), interp );
gdk_window_get_origin ( widget->window, &x, &y );
x += widget->allocation.x;
x -= widget->style->xthickness;
y += widget->allocation.y;
y -= widget->style->ythickness;
gtk_widget_size_request ( widget, &req );
w = req.width;
h = req.height;
sprintf ( buffer, "%d %d %d %d", x, y, w, h );
Tcl_SetObjResult ( interp, Tcl_NewStringObj ( buffer, -1 ) );
} |