Re: [Gtk+2] Reproduce the look of GtkTreeView header
- From: Kjell Ahlstedt <kjell ahlstedt bredband net>
- To: Maggio Mago <dev maggio gmail com>, gtkmm-list gnome org
- Subject: Re: [Gtk+2] Reproduce the look of GtkTreeView header
- Date: Fri, 03 Jan 2014 12:57:42 +0100
gtk-app-devel-list is probably better suited than gtkmm-list for this
question.
Kjell
2014-01-02 16:07, Maggio Mago skrev:
Hello,
I need to set a custom widget in the GtkTreeView header.
I have done this with gtk_tree_view_column_set_widget() but my widget
wasn't worked.
So i have created my custom header widget and set
gtk_tree_view_set_headers_visible(false).
However i can not reproduce the look of the TreeView header.
Maybe a problem of style
Can you help me to reproduce the look of a GtkTreeView header ?
Following my code:
/* @file my-header.c */
G_DEFINE_TYPE (MyHeader, my_header, GTK_TYPE_WIDGET)
static void
my_header_class_init(MyHeaderClass *klass)
{
GtkWidgetClass *gtkwidget_class;
gtkwidget_class = (GtkWidgetClass *) klass;
/* ... */
gtkwidget_class->expose_event = my_header_expose;
gtk_rc_parse_string ("widget_class '*.MyHeader' style
'treeview_header' ");
/* ... */
}
static gboolean
my_header_expose (GtkWidget *widget, GdkEventExpose *event)
{
gtk_paint_box(widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_NONE,
&event->area,
widget,
"button",
event->area.x, event->area.y, event->area.width,
event->area.height);
return FALSE;
}
PJ: Sample
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]