GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 25, 2014 7:48 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Changing style of <a href>-label
PostPosted: Sat Apr 06, 2013 8:13 am 
Offline
Familiar Face

Joined: Sun Mar 24, 2013 8:35 am
Posts: 6
gtk.Label('<a href="xxxxx">some text</a>') gives a label as a clickable link. It is automatically shown in blue and underlined. (How) can I change the style, e.g. remove the underlining and change the color?

Python 2.7.3, Windows7, gtk 2.24.10.


Top
 Profile  
 
 Post subject: Re: Changing style of <a href>-label
PostPosted: Sun Apr 07, 2013 4:11 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
Hello,

You can continue using mark-up text to change the colour and styles. For example your could have :-

'<color="green">Green text</color>'

_________________
E.


Top
 Profile  
 
 Post subject: Re: Changing style of <a href>-label
PostPosted: Tue Apr 09, 2013 11:49 am 
Offline
Familiar Face

Joined: Sun Mar 24, 2013 8:35 am
Posts: 6
errol,

Unfortunately the color-mark-up doesn't work here.

label = gtk.Label('<b><i>some text</i></b>') gives indeed bold and italic label-text, but

label = gtk.Label('<b><i><color="green">some text</color></i></b>') gives a label with the complete text between the quotes, thus not applying any mark-up. (In both cases I did include a line label.set_use_markup(True) ).

So the question remains how do I overwrite the default <a href>- style. In html I would use something like:
<style type="text/css">
a:link { color: #0000FF; text-decoration: none; }
a:visited { color: #0000FF; text-decoration: none; }
a:active { color: #0000FF; text-decoration: none; }
a:hover { color: #FF0000; text-decoration: none; }
</style>

So I am looking for its equivalent in gtk.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group