Re: Default font in Window & GtkWidget struct



>I want to know how I can change the default font in a window for all
>widgets in this window without change the font of each widget, and how
>to know more information about GtkWidget structure and how to manipulate
>with gdk functions too.

My favorite method, since its entirely under user-control and can be
changed without recompiling your code: in a GTK RC file:


------------------------------------------------------------
style "my_preferred_font" 
{
	font = "name of the font"
}

widget "*GtkWindow" style "my_preferred_font"
widget "*GtkWindow*" style "my_preferred_font"
------------------------------------------------------------

then just use gtk_rc_parse ("name of rc file") and you're all set.

you might also choose to name the window:

    gtk_widget_set_name (window_widget, "foobar");

and then use that in the RC file:

widget "*foobar" style "my_preferred_font"
widget "*foobar*" style "my_preferred_font"

--p




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