50
50
* convenience widget; you could construct the equivalent of #GtkMessageDialog
51
51
* from #GtkDialog without too much effort, but #GtkMessageDialog saves typing.
53
* One difference from #GtkDialog is that #GtkMessageDialog sets the
54
* #GtkWindow:skip-taskbar-hint property to %TRUE, so that the dialog is hidden
55
* from the taskbar by default.
53
57
* The easiest way to do a modal message dialog is to use gtk_dialog_run(), though
54
58
* you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically
55
59
* makes the dialog modal and waits for the user to respond to it. gtk_dialog_run()
387
391
setup_primary_label_font (GtkMessageDialog *dialog)
389
393
GtkMessageDialogPrivate *priv = dialog->priv;
391
PangoFontDescription *font_desc;
392
GtkStyleContext *context;
395
/* unset the font settings */
396
gtk_widget_override_font (priv->label, NULL);
398
395
if (priv->has_secondary_text && !priv->has_primary_markup)
400
context = gtk_widget_get_style_context (priv->label);
401
state = gtk_widget_get_state_flags (priv->label);
403
size = pango_font_description_get_size (gtk_style_context_get_font (context, state));
404
font_desc = pango_font_description_new ();
405
pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
406
pango_font_description_set_size (font_desc, size * PANGO_SCALE_LARGE);
407
gtk_widget_override_font (priv->label, font_desc);
408
pango_font_description_free (font_desc);
397
PangoAttrList *attributes;
398
PangoAttribute *attr;
400
attributes = pango_attr_list_new ();
402
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
403
pango_attr_list_insert (attributes, attr);
405
attr = pango_attr_scale_new (PANGO_SCALE_LARGE);
406
pango_attr_list_insert (attributes, attr);
408
gtk_label_set_attributes (GTK_LABEL (priv->label), attributes);
409
pango_attr_list_unref (attributes);
413
/* unset the font settings */
414
gtk_label_set_attributes (GTK_LABEL (priv->label), NULL);