Re: gtk_window_set_default/set_focus()



Soeren Sandmann <sandmann daimi au dk> writes:

> Owen Taylor <otaylor redhat com> writes:
> 
> > Remembered that the case you need to do this is if you
> > make the focus widget !CAN_FOCUS. Which strongly implies
> > we should have gtk_widget_set_can_focus() ... it's not
> > the caller's responsibility to maintain internal GTK+
> > invariants.
> 
> In the keyboard navigation patch for GtkPaned I set CAN_FOCUS when the
> handle should be focused, and !CAN_FOCUS when it shouldn't.

Hmmm, sounds a bit odd. The way GtkContainer's ->focus() method
works is that:

 - if CAN_FOCUS is set, then the widget itself is focusable  
   but not it's children.

 - if CAN_FOCUS is not set, then the widget's children are
   focused but not the widget itself.

I'd really expect GtkPaned to override ->focus() itself
rather than setting this flag; Toggling this flag on
the fly was never intended to be done normally.

Regards,
                                        Owen




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