Re: gtk_toggle_button_set_mode



John Sullivan <sullivan@eazel.com> writes: 
> I mostly just want to understand this, but I also think it's extremely
> confusing as is and should be improved in the future if possible.
> 

I spent 20 minutes trying to figure it out the other day too, and
whined about it to Owen. Most likely he said he was taking
patches. ;-)

Basically the function makes a GtkRadioButton or GtkCheckButton look
like a GtkToggleButton. Of course making a GtkCheckButton look like a
GtkToggleButton is pointless, because the only difference between
Check and Toggle is the appearance. So the whole point is to allow
radio buttons in toolbars. i.e. if you put a check or radio button in
a toolbar it gets magically "converted" into a big toolbar button
instead of the label-with-little-indicator type of button.

Maybe GtkToggleButton should be the only class, with set_display_style
(GtkToggleButtonStyle style), since the current inheritance hierarchy
doesn't make that much sense. (I suppose this could even be done
backward-compatibly, by making check/radio buttons into nearly empty
subclasses.) A similar argument can be made that all the H/V variants
like HBox/VBox should be done with a single concrete GtkBox class that
has two modes. Then again I suppose the whole class hierarchy could be
smashed into the all-seeing all-doing GtkWidget class with a set_type
(GTK_WIDGET_BUTTON) call, so at some point the argument breaks
down. ;-)

Havoc



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