wxStaticText GTK woes

Vadim Zeitlin vadim at wxwindows.org
Tue Jan 2 12:32:44 PST 2007


On Tue, 02 Jan 2007 09:08:58 +0200 Peter Gordon <peter at pg-consultants.com> wrote:

PG> On Windows it works either way. On GTK2, I can detect movement, but
PG> Entering and Leaving are always false, and I never get an ENTER or LEAVE
PG> event.
PG> 
PG> Is there a workaround on GTK2?

 Only to create an extra wxWindow, make wxStaticText child of it and catch
enter/leave for the outside window. wxStaticText itself doesn't have a real
window under GTK and so there are no entering/leaving events generated for
it. It would be nice to change wxGTK to create such container window
automatically but so far nobody had time to do it.

PG> A second problem I have is that I want the text to appear underlined. I
PG> use font.SetUnderlined(true) to set the font. Again, on Windows it works
PG> but on GTK2 there is no underlining. Again, any advice would be
PG> appreciated.

 GTK+ doesn't support underlined fonts natively so we have to deal with
this at wx level. In this particular case, we should be using
gtk_label_set_markup(wxString::Format("<u>%s</u>", label)) instead of
gtk_label_set_text(label) if the current font is underlined probably. If
you could make a patch (http://www.wxwidgets.org/technote/patches.htm)
implementing this, it would be most welcome.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list