Re: [gtk-list] GtkList & scrolled windows + yet another signal proposal




Tim Janik writes:

> so i think there is a need for yet another widget signal: GtkWidget::parent_set.
> 
> this signal will be invoked at the end of gtk_widget_set_parent() and at
> the beginning of gtk_widget_unparent().
> the signal will have the following semantics:
> 	void (*set_parent) (GtkWidget *widget, GtkContainer *parent);
> where parent is allowed to be NULL.
> 
> any comments? objections? (owen? ;)

;-) Well, you could always just check when you think you might need to
scroll.

if (widget->parent && widget->parent->parent && 
    gtk_type_is_a (widget->parent->parent (gtk_scrollbar_get_type)))
  {
    [ do whatever you need to do ]
  }

Shouldn't be that expensive compared to actually scrolling things...

There's nothing fundamentally wrong with a "parent_set" signal
though.

Regards,
                                        Owen



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