Re: [patch] Scrollable Widgets




On Thu, Oct 29, 1998 at 04:42:59PM -0500, Owen Taylor wrote:

> This looks quite good. I think using object args for the hadjustment
> and vadjustment is the right way to do it. (Wish I had thought of that
> myself.)
>
> However, to play the devil's advocate, the one problem I see with this
> is that it is quite difficult to make a scrollable "pseudo-widget", or
> to modify the behavior the scrolling behavior of an existing widget,
> since there is no equivalent of a user-signal for args. I can't take a
> drawing area and make it suitable for plugging into a ScrolledWindow.
> (In something other than the trivial sense of putting the scrolled
> window inside a viewport)

Ok, I did not see that problem. The only way to solve it is a new
widget signal or just a new widget class method... But I'm not sure
if we really need that possibility. I'll be much cleaner if one would
subclass a widget instead of writing a "pseudo-widget".

> A few comments:
>
> +         arg.name = "hadjustment";
> +         arg.type = info_hadj->type;
> +         GTK_VALUE_POINTER (arg) =
> +           gtk_scrolled_window_get_hadjustment (scrolled_window);
> +         gtk_object_arg_set (GTK_OBJECT (widget), &arg, info_hadj);
>
> Why not:
>
>   gtk_object_set (GTK_OBJECT (widget), "hadjustment",
>                   gtk_scrolled_window_get_hadjustment (scrolled_window));
>
> I don't think the performance benefits are worth the additional code.
>
> Also, to be on the conservative side, you might want to check that the
> "hadjustment" and "vadjustment" arguments you find actually have the
> expected type. (GTK_TYPE_ADJUSTMENT)

Ok, I'll change that. Basically I used GTK_TYPE_POINTER, because GtkViewport
uses it. ;)

> But in general, I would have no objections to this change being
> committed. However, since it does break source compatibility, it would
> be good to send out a short "this is what will break, and here's how
> to fix it" message to gtk-list and gnome-list before making the
> change, so people know what is going.

Sure. I'll wait a few days before committing these changes anyway.

bye,
  Lars



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