[gtk-list] usize vs requisition?




I was reading through a gtk widget code when I ran into this
function.

void gtk_gl_area_size (GtkGLArea *glarea, gint width, gint height)
{
  g_return_if_fail (glarea != NULL);
  g_return_if_fail (GTK_IS_GL_AREA (glarea));

  GTK_WIDGET (glarea)->requisition.width = width;
  GTK_WIDGET (glarea)->requisition.height = height;
}

At first I though this was completely reduntant as gtk_widget_set_usize
does this.  However, in looking at the gtk code I realized that this
was not what gtk did for set usize.

As it seems silly to add a requested size to later widgets shouldn't
there be a gtk_widget_set_rsize  for setting the requested size of an
object as well as a gtk_widget_set_usize to set the minumum size?

(I have been achieving the effect by setting the usize waiting for
allocation then setting the usize smaller so that people can shrink
the window.  However, it would be good if this wasn't necessary.)

Or is there already a function for requesting the inital allocation different
then the usize?

--Karl



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