Code: Select all
label_QuotesOn = new wxStaticText( itemDialog1, wxID_STATIC, _("Latest_quote: 99-99-9999 99h99"), wxDefaultPosition, wxDefaultSize, 0 );
label_QuotesOn->Show(false);
itemBoxSizer3->Add(label_QuotesOn, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
In the course of execution of the application, 'label_QuotesOn' is modified by the following code:
Code: Select all
wxString lastQuote = m_data.ShareQuoteDates->Last(); // '20/03/2020 17h43'
lastQuote.Replace("/","-"); // '20-03-2020 17h43'
wxString label = label_QuotesOn->GetLabel(); // 'Latest_quote: 99-99-9999 99h99'
int pos = label.Find("9");
label.Truncate(pos);
label.Append(lastQuote); // Should be 'Quotes on: 20-03-2020 17h43'
label_QuotesOn->Show();
label_QuotesOn->SetLabel(label);
label_QuotesOn->Fit();
Fit();
Layout();
Refresh();
Update();
Code: Select all
Thread 1 "AccountsManager" hit Breakpoint 1, RapportPortefeuille::OnTimerSharesQuotes (this=0x5555563b9400, event=...) at rapportportefeuille.cpp:505
505 lastQuote.Replace("/","-");
(gdb) p lastQuote
$1 = {static npos = 18446744073709551615, m_impl = L"20/03/2020 17h43",
m_convertedToChar = {m_str = 0x0, m_len = 0}}
(gdb) n
507 wxString label = label_QuotesOn->GetLabel(); // "Latest_quote: 99-99-9999 99-99"
(gdb) p lastQuote
$2 = {static npos = 18446744073709551615, m_impl = L"20-03-2020 17h43",
m_convertedToChar = {m_str = 0x0, m_len = 0}}
(gdb) n
509 int pos = label.Find("9");
(gdb) p label
$3 = {static npos = 18446744073709551615,
m_impl = L"Latest_quote: 99-99-9999 99-99", m_convertedToChar = {
m_str = 0x0, m_len = 0}}
(gdb) n
511 label.Truncate(pos);
(gdb) n
512 label.Append(lastQuote);
(gdb) n
514 label_QuotesOn->SetLabel(label);
(gdb) p label
$4 = {static npos = 18446744073709551615,
m_impl = L"Latest_quote: 20-03-2020 17h43", m_convertedToChar = {
m_str = 0x0, m_len = 0}}
(gdb) c
http://www.pixname.com/0001/Screenshot% ... -09-37.png
On Windows & OSX this code produces the expected display. Is there any reason why GTK+3 does not?