Re: Distinguish column header from normal button



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 (creating a fake treeview, adding a column, and passing a
widget somewhat deep in the columns child tree). Making it completely
private will prevent this from being possible at all.

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.

--Todd




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