Page 1 of 1

Problems with wxTopLevelWindow::SetTitle

Posted: Wed Jun 08, 2022 4:36 pm
by ColleenKobe

I can't get the wxTopLevelWindow::SetTitle command to work in my program. I can get it to work just fine in a separate program, but not here. It's driving me crazy.

Using CodeLite and wxCrafter, I built the program. There are no compiler or linking errors. I can step through the execution of the procedure. Title_wxSt gets set correctly. But when the procedure exits, the title bar contains the same string that I initialized it with using wxCrafter. The title should be different, but there is no change.

Here is a code snippet from the file with the procedure calling wxTopLevelWindow::SetTitle.

Code: Select all

#include <wx/toplevel.h>                //  6   // for wxTopLevelWindow::SetTitle

//  .
//  .
//  .

//  These identifiers are defined elsewhere but included here so you know what they are.

// #define gdb_UHSD_VERSION_NUMBER     "v2.0"
// #define gdb_UHSD_NAME_W_VERSION     "UHSD PRM Packet Verifier " gdb_UHSD_VERSION_NUMBER
//
// wxString    mf_PRM_Filename_wxSt;

void    MainFrame::mf_Update_MF_Title_Bar (void)
{

wxString    Title_wxSt;

if (mf_PRM_Filename_wxSt.IsNull ())
    mf_PRM_Filename_wxSt    = "New";

Title_wxSt = wxString::Format   ("%s - [%s]",   gdb_UHSD_NAME_W_VERSION, mf_PRM_Filename_wxSt);
wxTopLevelWindow::SetTitle  (Title_wxSt);

}   //  mf_Update_MF_Title_Bar

What am I missing?

Thanks!
Colleen