Re: How to set the font's size of the Gtklabel
- From: "Garth's KidStuff" <garthskidstuff gmail com>
- To: gtk-app-devel-list gnome org
- Subject: Re: How to set the font's size of the Gtklabel
- Date: Thu, 28 Aug 2008 06:50:18 -0700
Whops, hit the send button before I was finished..
the method should be:
void ChangeLabelFontSize(
Gtk::Label *pLabel, // [in] Pointer to label to change font on
float scale) // [in] amount to scale font size by. 1.0 leaves label
unchanged
{
Glib::RefPtr<Pango::Context> pPangoContext =
pLabel->get_pango_context();
Pango::FontDescription fontD =
pPangoContext->get_font_description();
fontD.set_size((int)(scale * fontD.get_size()));
pLabel->modify_font(fontD);
}
--
Garth Upshaw
Garth's KidStuff
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]