Version française
Home     About     Download     Resources     Contact us    
Browse thread
lablgtk pango_parse_markup
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] lablgtk pango_parse_markup
This is directly supported by the label widget:

let w = GWindow.window ()
let l = GMisc.label ~packing:w#add ()
let () =
  l#set_text "<span foreground=\"red\">Hello</span>";
  l#set_use_markup true;
  w#show ();
  GMain.main ()

This is even shorter as optional argument:

let l = GMisc.label ~packing:w#add ~markup:"<span foreground=\"red\">Hello</span>" ()

Jacques Garrigue

On 2010/11/29, at 22:20, Daniel de Rauglaudre wrote:

> Hi,
> 
> I'd like to have a "label" widget in Lablgtk with a string with
> internationalization, bold, italic, utf8, color, things like that.
> 
> I am not sure, but I saw in the Web that I must use the function
> "pango_parse_markup" and XML tags in my string, but that function
> seems not to exist in Lablgtk. Is it normal? Do I have to use other
> features?
> 
> Thanks.
> 
> -- 
> Daniel de Rauglaudre
> http://pauillac.inria.fr/~ddr/