Gtk2::Entry with Pango markup


I'm have Gtk2::Entry where users are expected to enter an XPath
expression. I would like to let the user know when an expression isn't
valid. I thought of using Pango markup but it seems very hard to do
with a Gtk2::Entry.

For the moment I can use a callback to 'changed' and set the markup this way:
$widget->get_layout->set_markup("<span underline='error'

The problem is that it doesn't work too well. The markup is not always
shown. When I edit the widget for the first time the error is not
displayed only after I start erasing at least one character while
keeping the XPath expression invalid.

I tried using a Gtk2::TextView but I didn't find out how to give the
text view the exact height of one line (just as a Gtk2::Entry).

Is there another way of achieving this?

Emmanuel Rodriguez

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]