GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Nov 28, 2014 6:06 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: The color of a label
PostPosted: Tue Jun 05, 2007 4:15 pm 
Offline
Familiar Face

Joined: Fri May 18, 2007 4:40 pm
Posts: 8
Hi all.
I wish to change the color and the size of the text of a label.How to do?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 5:28 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
You could use...
gtk_label_set_markup
Text Attribute Markup
...for changing color and for changing the font...
Code:
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

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 4:14 pm 
Offline
Familiar Face

Joined: Fri May 18, 2007 4:40 pm
Posts: 8
Thank you for reply Micah


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 1:38 am 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
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:
<span size="13000" weight="bold" foreground="red">Hello, World</span>



This is what the label would look like.
Hello, World


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group