In the denemo music program it would be useful for the class GtkLabel to
default to use_markup TRUE (so that the music font could be freely
used). I have tried traversing the widgets setting this value, thus

static void use_markup(GtkWidget *widget)
{
  if(GTK_IS_LABEL(widget)) {
    gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
  }
  else
 if(GTK_IS_CONTAINER(widget)) {
    GList *g = gtk_container_get_children (GTK_CONTAINER(widget));
    for(;g;g=g->next)
      use_markup(g->data);
    if (GTK_IS_MENU_ITEM(widget)) {
      use_markup(gtk_menu_item_get_submenu(widget));
    }
 }
}

but this curiously fails for toolitems (the GtkLabel widget in the
GtkToolButton changes under some condition, perhaps to do with
accelerators).

I wondered if there was a call to be made to set the default for the
class, but when I looked at the source I became more perplexed:
gtklabel.c has a function
static void gtk_label_class_init (GtkLabelClass *class)
which is not called within the file, even though it is static. Short of
some preprocesser magic, I can't see how this could ever get called.

Is there a way to set the class defaults?

Richard Shann


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to