Re: fixed width font labels

Mike Aubury wrote:
So should I use something like :

gtk_rc_parse_string("style \"fixed\" {font_name=\"Sans Italic 10\"} class \"GtkLabel\" style \"fixed\"");
  mylabel=gtk_label_new("Some Text");

(Ok - thats not fixed - but its easier to see italics for testing)..

If you want all your labels to share the same font, yes.

But like this:
gchar rc_string =
    "style \"italic\" {font_name=\"Sans Italic 10\"} "
    "widget \"my_italic_label\" style \"italic\""

/* ... */

mylabel = gtk_label_new("Some Text");
gtk_widget_set_name(GTK_WIDGET(mylabel), "my_italic_label");

/* ... */


You will have an easier time maintaining your UI if you
skin your widgets by name.

Furthermore, if you use an rcfile you will be able to reskin
your UI without re-compiling your application (same goes for
using libglade ;-), many consider this to be a big win.


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