GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The color of a label

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
javigis
Familiar Face


Joined: 18 May 2007
Posts: 8

PostPosted: Tue Jun 05, 2007 4:15 pm    Post subject: The color of a label Reply with quote

Hi all.
I wish to change the color and the size of the text of a label.How to do?

Thanks in advance.
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 505
Location: Portland, OR USA

PostPosted: Tue Jun 05, 2007 5:28 pm    Post subject: Reply with quote

You could use...
gtk_label_set_markup
Text Attribute Markup
...for changing color and for changing the font...
Code: (Plaintext)
1
2
3
fd = pango_font_description_from_string ("monospace 10");
gtk_widget_modify_font (label, fd);
pango_font_description_free (fd);


See more about Pango and the pango_font_description_xxxx functions at Pango Fonts
Back to top
javigis
Familiar Face


Joined: 18 May 2007
Posts: 8

PostPosted: Thu Jun 07, 2007 4:14 pm    Post subject: Reply with quote

Thank you for reply Micah
Back to top
caracal
GTK+ Geek


Joined: 21 Jun 2007
Posts: 91
Location: Wilkes Barre Pa

PostPosted: Fri Jun 29, 2007 1:38 am    Post subject: Reply with quote

If your using glade what you do is click the "use markup option" in the right side panel then look on the right side panel for the label entry and you will see a textbox in this textbox you could do something like this.

Code: (Plaintext)
1
<span size="13000" weight="bold" foreground="red">Hello, World</span>



This is what the label would look like.
Hello, World
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP