|
2009-09-01
, 02:20
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#12
|
Interesting. It looks like you get to go down the myMessageDialog.set_markup(myPangoMarkupStr) rabbit hole. This will lead you here:
Pango Markup Language
It doesn't look too bad. Report back!
|
2009-09-01
, 17:40
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#13
|
myMessage = 'Blue text' fontSize = 100 myMessageDialog.label.set_markup("<span foreground=\"blue\" size=\"%d\">%s</span> is <i>cool</i>!" % (fontSize,myMessage))
|
2009-09-01
, 18:19
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#14
|
It's kinda cool when you think about it. From the example just try the following:
Code:myMessage = 'Blue text' fontSize = 100 myMessageDialog.label.set_markup("<span foreground=\"blue\" size=\"%d\">%s</span> is <i>cool</i>!" % (fontSize,myMessage))
|
2009-09-01
, 19:46
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#15
|
The only thing I see is "is cool!", with "cool" in italics, and with the same usual font. That is, no "Blue text", and the same old fonts.
Anyway, could I apply this to change the fonts inside a gtk.ComboBox?
Thanks,
L.
The font size in thousandths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.
The Following User Says Thank You to daperl For This Useful Post: | ||
|
2009-09-01
, 20:18
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#16
|
The Following User Says Thank You to daperl For This Useful Post: | ||
|
2009-09-03
, 14:31
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#17
|
Yes, gtk.ComboBox implements the gtk.CellLayout interface. It's mildly complex, so maybe start at this tutorial.
|
2009-09-03
, 14:32
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#18
|
Oh yeah, sorry. I think the example is using a bad size value. Try 7200 instead of 100.
|
2009-09-03
, 15:05
|
|
Posts: 299 |
Thanked: 168 times |
Joined on Jun 2006
@ Wales UK
|
#19
|
gtk.rc_parse_string("""
style "font"
{
font_name = "Sans 12"
}
widget_class "*" style "font" """)
|
2009-09-04
, 04:17
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#20
|
Yes, gtk.ComboBox implements the gtk.CellLayout interface. It's mildly complex, so maybe start at this tutorial.
Pango Markup Language
It doesn't look too bad. Report back!
N9: Go white or go home