gtk_widget_set_rc_style(entry); gtk_widget_realize(entry);
gtk_widget_ensure_style(entry);
nsSystemFontsGTK::nsSystemFontsGTK(float aPixelsToTwips)  : mDefaultFont("sans-serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,                 NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE,                 DEFAULT_TWIP_FONT_SIZE),    mButtonFont("sans-serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,                NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE,                DEFAULT_TWIP_FONT_SIZE),    mFieldFont("sans-serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,               NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE,               DEFAULT_TWIP_FONT_SIZE),    mMenuFont("sans-serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,               NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE,               DEFAULT_TWIP_FONT_SIZE){  /*   * Much of the widget creation code here is similar to the code in   * nsLookAndFeel::InitColors().   */  // mDefaultFont  GtkWidget *label = gtk_label_new("M");  GtkWidget *parent = gtk_fixed_new();  GtkWidget *window = gtk_window_new(GTK_WINDOW_POPUP);  gtk_container_add(GTK_CONTAINER(parent), label);  gtk_container_add(GTK_CONTAINER(window), parent);  gtk_widget_set_rc_style(parent);  gtk_widget_set_rc_style(label);  gtk_widget_realize(parent);  gtk_widget_realize(label);  GetSystemFontInfo(label, &mDefaultFont, aPixelsToTwips);  gtk_widget_destroy(window);  // no unref, windows are different  // mFieldFont  GtkWidget *entry = gtk_entry_new();  parent = gtk_fixed_new();  window = gtk_window_new(GTK_WINDOW_POPUP);  gtk_container_add(GTK_CONTAINER(parent), entry);  gtk_container_add(GTK_CONTAINER(window), parent);  gtk_widget_set_rc_style(entry);  gtk_widget_realize(entry);  GetSystemFontInfo(entry, &mFieldFont, aPixelsToTwips);  gtk_widget_destroy(window);  // no unref, windows are different  // mMenuFont  GtkWidget *accel_label = gtk_accel_label_new("M");  GtkWidget *menuitem = gtk_menu_item_new();  GtkWidget *menu = gtk_menu_new();  gtk_object_ref(GTK_OBJECT(menu));  gtk_object_sink(GTK_OBJECT(menu));  gtk_container_add(GTK_CONTAINER(menuitem), accel_label);  gtk_menu_append(GTK_MENU(menu), menuitem);  gtk_widget_set_rc_style(accel_label);  gtk_widget_set_rc_style(menu);  gtk_widget_realize(menu);  gtk_widget_realize(accel_label);  GetSystemFontInfo(accel_label, &mMenuFont, aPixelsToTwips);  gtk_widget_unref(menu);  // mButtonFont  parent = gtk_fixed_new();  GtkWidget *button = gtk_button_new();  label = gtk_label_new("M");  window = gtk_window_new(GTK_WINDOW_POPUP);            gtk_container_add(GTK_CONTAINER(button), label);  gtk_container_add(GTK_CONTAINER(parent), button);  gtk_container_add(GTK_CONTAINER(window), parent);  gtk_widget_set_rc_style(button);  gtk_widget_set_rc_style(label);  gtk_widget_realize(button);  gtk_widget_realize(label);  GetSystemFontInfo(label, &mButtonFont, aPixelsToTwips);  gtk_widget_destroy(window);  // no unref, windows are different}