Re: Default behaviour patch




George <jirka@5z.com> writes:

> Here is the patch to emulate motif behaviour with respect to default
> button handeling it adds a widget flag RECEIVE_DEFAULT which marks
> widgets that will take default when they are focused (currently
> gtkbutton and gtktogglebutton are set up like that) ... also drawing
> of the default frame is now conditional to if there is a RECEIVE_DEFAULT
> widget focused or not, and if it CAN_DEFAULT then the frame is
> drawn around the focused RECEIVE_DEFAULT widget
> 
> also this makes the gnome-dialog patch obscolete

[...]

> +      if ((GTK_WIDGET_HAS_DEFAULT (widget) &&
> +	   GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL &&
> +	   (!toplevel->focus_widget ||
> +	    toplevel->focus_widget == widget ||
> +	    !GTK_WIDGET_RECEIVES_DEFAULT (toplevel->focus_widget))) ||
> +	  (GTK_WIDGET_CAN_DEFAULT (widget) &&
> +	   GTK_WIDGET_HAS_FOCUS (widget) &&
> +	   GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL))

This is mess (an 8 line if statement???). I don't think this is 
the right way to go about this at all. 

I think GTK_WIDGET_HAS_DEFAULT (widget) should indicate whether
or not the widget should draw the focus. period.

GtkWindow should set and unset HAS_DEFAULT from widgets 
based on the values of window->focus_widget and 
window->default_widget. 

Regards,
                                        Owen




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