gtk_bin_size_request



Maybe there's no interest in making this change given the impending
1.0ness of gtk, but I would suggest that gtk_bin_size_request be added
as follows.  It would remove the method from gtkalignment and
gtkeventbox, and most of the others if one more change was made: set
req->width and req->height to zero before calling ->size_request().

IMHO, it's better to say "I'm a X, but I Y" than "I XY".
-russ

static void
gtk_bin_size_request (GtkBin         *widget,
		      GtkRequisition *requisition)
{
  g_return_if_fail (widget != NULL);
  g_return_if_fail (GTK_IS_BIN (widget));
  g_return_if_fail (requisition != NULL);

  requisition->width = GTK_CONTAINER (widget)->border_width * 2;
  requisition->height = GTK_CONTAINER (widget)->border_width * 2;

  if (widget->child && GTK_WIDGET_VISIBLE (widget->child))
    {
      gtk_widget_size_request (widget->child, &widget->child->requisition);

      requisition->width += widget->child->requisition.width;
      requisition->height += widget->child->requisition.height;
    }
}

-- 
-russ <nelson@crynwr.com>  http://web.crynwr.com/~nelson
Crynwr supports Open Source(tm) Software| PGPok |   Freedom is the primary
521 Pleasant Valley Rd. | +1 315 268 1925 voice |   cause of Peace, Love,
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   |   Truth and Justice.



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