Getting Size from Widgets




How would one get the width and height of a widget?  I am trying the
following; however, it always returns 1 for both width and height.

void foo(GtkWidget *widget) 
{
   gint width, height;

   gdk_window_get_size(widget->window, &width, &height);

   g_print("%d, %d\n", width, height);
}

Thanks for your help!

--Brian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]