Re: GTK TreeView Column Header Colors

2003-11-20 Thread Manuel Op de Coul

Tim Evans wrote:
It is possible, just not particularly obvious.  What you need to do is
call gtk_tree_view_column_set_widget, passing in your own label that is
set to display the column title.  Once the label is shown and realized,
call gtk_widget_get_parent three times, which should move up through a
GtkAlignment and a GtkHBox to give you a GtkButton.  This button is the
column header.  Calling gtk_widget_modify_bg on it will change the
background colour of the column header.

Thanks for this insider tip! I realised that this might also be a
workaround the problem I had setting tooltips to treeview column headers
(also clist's). I tried it and it was.
Setting the tooltip to the result of a triply nested Get_Parent call on
the label does the trick. The fact that it must be shown and realized
also makes it more cumbersome than the old method with eventboxes though.
The next Gtk version will probably get a new routine for it.

Manuel


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK TreeView Column Header Colors

2003-11-20 Thread Carl B. Constantine
* Tim Evans ([EMAIL PROTECTED]) wrote:
 It is possible, just not particularly obvious.  What you need to do is 
 call gtk_tree_view_column_set_widget, passing in your own label that is 
 set to display the column title.  Once the label is shown and realized, 
 call gtk_widget_get_parent three times, which should move up through a 
 GtkAlignment and a GtkHBox to give you a GtkButton.  This button is the 
 column header.  Calling gtk_widget_modify_bg on it will change the 
 background colour of the column header.

not particularly obvious is a bit of an understatement, but THANK YOU
very much for the information. I didn't realize you could do it that
way, but it does make sense now that I look at it.

-- 
 .''`.  Carl B. Constantine
: :' : [EMAIL PROTECTED]
`. `'GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom
  Claiming that your operating system is the best in the world because more
  people use it is like saying McDonalds makes the best food in the world.


pgp0.pgp
Description: PGP signature


Re: GTK TreeView Column Header Colors

2003-11-19 Thread Tim Evans
Carl B. Constantine wrote:

* Mike Dailey ([EMAIL PROTECTED]) wrote:

Is it possible to change the foreground and background
color of the column header in a GTK TreeView, using a
ListStore as the model?


Nope, I tried and tried. the Header lables, AFAICT, cannot be changed
from the standard colors. I'd be interested if anyone can prove me wrong
though.
It is possible, just not particularly obvious.  What you need to do is 
call gtk_tree_view_column_set_widget, passing in your own label that is 
set to display the column title.  Once the label is shown and realized, 
call gtk_widget_get_parent three times, which should move up through a 
GtkAlignment and a GtkHBox to give you a GtkButton.  This button is the 
column header.  Calling gtk_widget_modify_bg on it will change the 
background colour of the column header.

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list