Re: How to set the font's size of the GtkLabel?

2008-08-28 Thread Lazy Fox
I find another way: +- | PangoFontDescription * desc = pango_font_description_new(); | pango_font_description_set_size(desc, 50*PANGO_SCALE); | . | . | gtk_widget_modify_font(label, desc); +-

Re: How to set the font's size of the Gtklabel

2008-08-28 Thread Lazy Fox
But I only use gtk api, not gtkmm. How to do this by gtk? On Thu, Aug 28, 2008 at 9:50 PM, Garth's KidStuff <[EMAIL PROTECTED]>wrote: > Whops, hit the send button before I was finished.. > > the method should be: > > void ChangeLabelFontSize( >Gtk::Label *pLabel, // [in] Pointer to label to

Re: How to set the font's size of the GtkLabel?

2008-08-28 Thread Lazy Fox
Is the pango markup language most popular way to set font's style? On Thu, Aug 28, 2008 at 8:16 PM, Tomas Carnecky <[EMAIL PROTECTED]> wrote: > Dov Grobgeld wrote: > > Hi Lazy (great name), > > > > The way to do it is to set the name of the label through: > > > > gtk_widget_set_name(label, "f

Re: How to set the font's size of the Gtklabel

2008-08-28 Thread Garth's KidStuff
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 pPangoContext = pLabel

Re: How to set the font's size of the Gtklabel

2008-08-28 Thread Garth's KidStuff
Hey there, Using Gtkmm void ChangeLabelFontSize( Glib::RefPtr pPangoContext = pLabel->get_pango_context(); Pango::FontDescription fontD = pPangoContext->get_font_description(); fontD.set_size((int)(scale * fontD.get_size())); pLabel->modify_font(fontD); -- Gar

Re: How to set the font's size of the GtkLabel?

2008-08-28 Thread Dov Grobgeld
Hi Tomas, You are certainly right The style method is more suited when you want to change additional properties like background color, etc. I stand corrected. Regards, Dov 2008/8/28 Tomas Carnecky <[EMAIL PROTECTED]> > Dov Grobgeld wrote: > > Hi Lazy (great name), > > > > The way to do it is to

Re: How to set the font's size of the GtkLabel?

2008-08-28 Thread Tomas Carnecky
Dov Grobgeld wrote: > Hi Lazy (great name), > > The way to do it is to set the name of the label through: > > gtk_widget_set_name(label, "foo"); > > and then define a style for the name "foo", that includes a font > specification: > > gtk_rc_parse_string("style \"foo\" {\n" >

Re: How to set the font's size of the GtkLabel?

2008-08-28 Thread Dov Grobgeld
Hi Lazy (great name), The way to do it is to set the name of the label through: gtk_widget_set_name(label, "foo"); and then define a style for the name "foo", that includes a font specification: gtk_rc_parse_string("style \"foo\" {\n" "font = \"Seri

How to set the font's size of the GtkLabel?

2008-08-28 Thread Lazy Fox
I wrote the following statememts to set a GtkLabel's font size. But it seems don't work? I'm not good at Pango, can anybody help me? +--- | PangoAttrList *pg_attr_list = pango_attr_list_new(); | PangoAttribute *