wxStaticText() Wrap function and line spacing

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Ishtar
Experienced Solver
Experienced Solver
Posts: 58
Joined: Mon May 20, 2013 6:33 pm

wxStaticText() Wrap function and line spacing

Post by Ishtar » Mon Sep 23, 2019 12:14 am

Hi All,

I have a problem on some Linux distributions where wxStaticText::Wrap() does not leave enough spacing between the lines. Note, this does not happen on all Linux distributions / Desktops.

A code example is as follows:

Code: Select all

wxString t1 = "A very long line of text";
wxStaticText * text1 = new wxStaticText(this, wxID_ANY, t1, wxDefaultPosition, wxDefaultSize, 0);

wxFont font = wxFont(FONT_SMALL, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false);
text1->SetFont(font);
text1->Wrap(350);

sizer_text->Add(text1, 0, wxTOP, 0);
sizer->Add(sizer_text, 0, wxALL | wxEXPAND, 10);

Here is a screenshot which demonstrates the problem:
wrap.png
wrap.png (10.48 KiB) Viewed 70 times
Can anybody advise on how to add extra space between the lines?

Thanks
Amanda

Post Reply