docs: question_index: Some documentation fixes
This commit is contained in:
@ -675,19 +675,19 @@ How do I change the font of a widget?
|
|||||||
This has several possible answers, depending on what exactly you want to
|
This has several possible answers, depending on what exactly you want to
|
||||||
achieve. One option is gtk_widget_modify_font(). Note that this function
|
achieve. One option is gtk_widget_modify_font(). Note that this function
|
||||||
can be used to change only the font size, as in the following example:
|
can be used to change only the font size, as in the following example:
|
||||||
<programlisting>
|
<informalexample><programlisting>
|
||||||
PangoFontDesc *font_desc = pango_font_description_new (<!-- -->);
|
PangoFontDesc *font_desc = pango_font_description_new (<!-- -->);
|
||||||
pango_font_description_set_size (font_desc, 40);
|
pango_font_description_set_size (font_desc, 40);
|
||||||
gtk_widget_modify_font (widget, font);
|
gtk_widget_modify_font (widget, font);
|
||||||
pango_font_description_free (font_desc);
|
pango_font_description_free (font_desc);
|
||||||
</programlisting>
|
</programlisting></informalexample>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If you want to make the text of a label larger, you can use
|
If you want to make the text of a label larger, you can use
|
||||||
gtk_label_set_markup():
|
gtk_label_set_markup():
|
||||||
<programlisting>
|
<informalexample><programlisting>
|
||||||
gtk_label_set_markup (label, "<big>big text</big>");
|
gtk_label_set_markup (label, "<big>big text</big>");
|
||||||
</programlisting>
|
</programlisting></informalexample>
|
||||||
This is preferred for many apps because it's a relative size to the
|
This is preferred for many apps because it's a relative size to the
|
||||||
user's chosen font size. See g_markup_escape_text() if you are
|
user's chosen font size. See g_markup_escape_text() if you are
|
||||||
constructing such strings on the fly.
|
constructing such strings on the fly.
|
||||||
@ -988,7 +988,7 @@ This is not ideal, since it can cause some flickering.
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Create the cairo context inside the expose handler. If you do this,
|
Create the cairo context inside the expose handler. If you do this,
|
||||||
gdk_create_cairo() arranges for it to be backed by the double-buffering
|
gdk_cairo_create() arranges for it to be backed by the double-buffering
|
||||||
pixmap. This is the preferred solution, and is used throughout GTK+
|
pixmap. This is the preferred solution, and is used throughout GTK+
|
||||||
itself.
|
itself.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
Reference in New Issue
Block a user