Re: Distinguish column header from normal button



2005/9/14, Todd Berman <tberman off net>:
> On Tue, 2005-09-13 at 17:48 -0500, Federico Mena Quintero wrote:
> > On Tue, 2005-09-13 at 23:45 +0200, Richard Stellingwerff wrote:
> >
> > > To distinguish Column headers from normal buttons, I check if its
> > > parent is a GtkTreeView or a GtkCList. A horrible way, but afaik the
> > > only way.
> > > In order to properly distinguish a column header from a normal button,
> > > I was thinking about setting a name on the column header button, using
> > > gtk_widget_set_name. Perhaps something like "Header:First",
> > > "Header:Middle", and "Header:Last".
> >
> > The right way to do it is to add a private API to GtkButton, so that the
> > tree view can tell the button which hint to pass to the gtk_paint_*()
> > functions.  The theme engine will then use this hint to draw the proper
> > box type for the tree column's buttons.
> >
> 
> Please no.
> 
> The current hacks that 3rd party developers have to go through when they
> want to render something that looks like a themed native treeview header
> are bad enough

Hacks are always bad. Even if they work.

> Although, I guess if this means the hacky stuff theme authors do to see
> if the widget's parent is a treeview, or clist, or etree (in clearlooks
> case) would be removed, and then widget authors could just pass in the
> proper detail to the paint_box calls would end up being a win. But only
> once all themes support it, until then, they would have to figure out
> which way the theme uses to detect it needs to draw a treeview header
> and act accordingly.

Are you really suggesting that implementing a good way to do things
should be pending on <insert good estimate of amount> hackily
implemented themes to be fixed (to the implementation that doesn't
exist) or working around those hackily implemented themes?

Sounds like a bad suggestion to me.

Good themes wwould be fixed promptly anyway (by social pressure or by
contributions), bad ones are not that critical ;)

I'd definitely go for it.

-- 
Kalle Vahlman, zuh iki fi



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