caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] lablgtk pango_parse_markup
Date: Tue, 30 Nov 2010 11:20:22 +0800	[thread overview]
Message-ID: <D7CE5D93-4D7E-4FF5-9F9C-D1D9FA23DD6A@gmail.com> (raw)
In-Reply-To: <20101129142053.GB25177@yquem.inria.fr>

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/


  reply	other threads:[~2010-11-30  3:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 14:20 Daniel de Rauglaudre
2010-11-30  3:20 ` Jacques Garrigue [this message]
     [not found] ` <1084802834.912456.1291087242788.JavaMail.root@zmbs3.inria.fr>
2010-11-30  8:54   ` [Caml-list] " Daniel de Rauglaudre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D7CE5D93-4D7E-4FF5-9F9C-D1D9FA23DD6A@gmail.com \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=daniel.de_rauglaudre@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).