Re: gtk_databox_ruler
- From: Scott Smedinghoff <schmeds fnal gov>
- To: gtkdatabox-list gnome org
- Subject: Re: gtk_databox_ruler
- Date: Tue, 01 Sep 2009 08:34:30 -0500
gtk_databox_get_ruler_x returns a pointer to the GtkDataboxRuler type.
So if you want to use it as a widget, you're going to have to cast it to
a widget at some point. Either declare ruler as a *GtkDataboxRuler and use
gtk_widget_modify_bg(GTK_WIDGET(ruler), GTK_STATE_NORMAL, &color);
or declare ruler as a *GtkWidget and then use
ruler = GTK_WIDGET(gtk_databox_get_ruler_x(GTK_DATABOX(box));
Either solution will work fine. You can always use an object as any of
its inherited types, but you have to cast it.
-Scott
Michael Steinbauer wrote:
Hi Scott,
Use gtk_databox_get_ruler_x (or y for the other ruler) to get the ruler,
then use gtk_widget_modify_bg to modify the background color and
gtk_widget_modify_fg to modify the text color.
I got the ruler like this:
GtkDataboxRuler *ruler;
.
.
.
ruler = gtk_databox_get_ruler_x(GTK_DATABOX(box));
// but it's not working, because ruler is a wrong pointer typ for
gtk_widget_modify_bg(ruler, GTK_STATE_NORMAL, &color);
Then I tried to make a GtkWidget *ruler, but then there is not o.k. for ...get_ruler function. Do you know the solution for this problem?
Thanks a lot,
Michael
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]