RE: gtk_ctree_node_get_row_style()



On Sat, 17 Oct 1998, Lars Hamann wrote:

> 
> On Sat, Oct 17, 1998 at 05:59:33AM -0400, Stuart Parmenter wrote:
> 
> > gtk_ctree_node_get_row_style() returns NULL on a ctree node that hasn't been
> > shown yet (?)
> 
> No, it returns NULL until you changed it yourself.
> 
> > I need to do this before I set the style, so that I get the
> > style correctly, i.e. the stuff that gtkrc sets.  Otherwise, I set the font,
> > and it removes the background color, etc that the user may have specified
> > already.
> 
> Like row fore/background colors, row and cell styles can't be changed out
> of gtkrc. Only the ctree style can be changed.

we could feature column styles for clist from the rc files,
currently widgets retrive their styles via

GtkStyle* gtk_rc_get_style              (GtkWidget   *widget);

which actually just needs the widget pointer to build the style path out of
the widgets and its parents names or classes, e.g.
MyWindow.GtkHBox.MyCList or GtkWindow.GtkHBox.GtkCList.
we could provide an additional function

GtkStyle* gtk_rc_get_sub_style          (GtkWidget   *widget,
                                         const gchar *sub);
that could be used as
  for (i = 0; i < clist->columns; i++)
  {
    gchar buffer[32];
    sprintf (buffer, "column%u", i);
    style = gtk_rc_get_sub_style (GTK_WIDGET (clist), buffer);
  }
and would produce (and try to match) widget paths like
MyWindow.GtkHBox.MyCList:column1 or GtkWindow.GtkHBox.GtkCList:column2.
this would of course only work for columns and not be usefull for rows...

so lars, do you need gtk_rc_get_sub_style() ? ;)

> > So my question is: how should I go about setting the font without
> > overwriting the other things?
> 
> Just copy the ctree style, change the font and set it as row style.
> 
> bye,
>   Lars
> 
> 

---
ciaoTJ



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