Re: GtkAspectFrame fluff



On Sun, 2004-08-01 at 06:14, Daniel Brockman wrote:

> The following idiom occurs more than once in my code:
> 
>   aspect_frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, 0, TRUE);
>   g_object_set (aspect_frame, "shadow-type", GTK_SHADOW_NONE, NULL);
>   {
>     GtkRcStyle *rcstyle = gtk_rc_style_new ();
>     rcstyle->xthickness = 0;
>     rcstyle->ythickness = 0;
>     gtk_widget_modify_style (aspect_frame, rcstyle);
>     gtk_rc_style_unref (rcstyle);
>   }
> 
> In my mind, GtkAspectFrame is a weird package deal; I really don't see
> how maintaining an aspect ratio has anything to do with frames.  Why
> not GtkAspectButton or GtkAspectExpander?

Well, basically because a child with a frame around it was the widget I
needed when I wrote it. And standards for getting things into GTK+
were looser back then. The number of people that have used it in
the intervening 7 years probably could be counted on the fingers of
one hand.

> Wouldn't it make sense to pull the aspect ratio logic out of
> GtkAspectFrame and provide an aspect-ratio-preserving container that
> does not try to draw labels or borders around your things, but just do
> the aspect ratio part?

Won't work. The aspect ratio has to be enforced on the child's size
not the child size + the border size.

[...]

> I realize that the long-term goal is to build height-for-width layout
> into the guts of GTK+, which would be awesome and probably render
> irrelevant all that I've said so far.  Am I right in assuming that
> such a thing would eliminate the need for Gtk*Aspect* anything?

height-for-width would allow eliminating the excess space that
GtkAspectFrame leaves around the widget in many cases, but you'd
still need some widget to achieve the aspect-preserving behavior. 

Regards,
						Owen

Attachment: signature.asc
Description: This is a digitally signed message part



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