Re: pango_layout_set_text doesn't drop old markup attributes
- From: Behdad Esfahbod <behdad behdad org>
- To: Theo Veenker <Theo Veenker let uu nl>
- Cc: gtk-i18n-list gnome org
- Subject: Re: pango_layout_set_text doesn't drop old markup attributes
- Date: Fri, 15 Feb 2008 12:41:00 -0500
On Fri, 2008-02-15 at 10:31 +0100, Theo Veenker wrote:
> Hi,
>
> When I call pango_layout_set_markup(layout, "<b>foo</b>...") on a
> layout object and then later call pango_layout_set_text() on the
> same layout object the text changes, but the markup is still there.
>
> I suppose this is unintentional. Can I kill the markup without
> recreating the layout object?
This is in fact intentional, though surprising at first.
pango_layout_set_markup() docs refer to
pango_layout_set_markup_with_accel() which clearly says it "[r]eplaces
the current text and attribute list." So if you change text later, it's
up to you to clear attribute list.
If pango_layout_set_text() was changed to clear attribute list, that
would break code that first sets attributes on the layout then sets
text.
I'll add a note to the docs for set_text() though.
> TIA.
>
> Theo
--
behdad
http://behdad.org/
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]