It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I'm using wxWidgets, and I'm trying to make a frame with a notebook in it, and when I add a tab to the notebook, it should fill that tab with another specific kind of frame (MyFrame), which has a toolbar along the top and the rest under that is a splitter window. What goes in the toolbar and splitter window is irrelevant at the moment.

The problem that I'm having is that when I try to create the new tab, first of all, it's showing the toolbar correctly (though it's empty, just because I haven't added anything to it), but it doesn't seem to be showing the splitter window correctly, because there's no vertical line for me to move left and right, to change where the two sides of the window appear.

The other weird problem that I'm having is that it's opening the MyFrame in a new popup window rather than displaying it in the tab. The tab gets created properly (I didn't include that code, because it's a whole other can of worms, but it's working correctly), but it stays empty, while the new popup window displays.

Here's the definition of MyFrame:

class MyFrame : public wxFrame
{
public:
MyFrame(wxWindow* parent, const wxString& title);
wxToolBar* toolbar;
};

Here's the constructor for it:

MyFrame::MyFrame(wxWindow* parent, const wxString& title) : wxFrame(parent, wxID_ANY, title)
{
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);

toolbar = new wxToolBar(this, wxID_ANY);
toolbar->Realize();

vbox->Add(toolbar, 0, wxEXPAND);

wxSplitterWindow* splitterWindow = new wxSplitterWindow(this, wxID_ANY);
splitterWindow->SplitVertically(new wxWindow(splitterWindow, wxID_ANY), new wxWindow(splitterWindow, wxID_ANY));

vbox->Add(splitterWindow, 0, wxEXPAND);

SetSizer(vbox);
}

Here's the part that is trying to create the new frame and put it into the notebook:

MyFrame* myFrame = new MyFrame(myNotebook, myTabName);
myNotebook->AddPage(myFrame, myTabName);

So what could be wrong with this? Thanks if you can help me.
Post edited April 19, 2023 by HeresMyAccount
No posts in this topic were marked as the solution yet. If you can help, add your reply
I fixed it. First of all, I should have made the frame a window instead, and then the splitter window just wasn't displaying anything that would be visible, which explains why I didn't see anything, though I guess I thought it would have had the separating line regardless. Anyway, it works now.
Fantastic. Not sure why you made another thread.

Please post in your original thread: https://www.gog.com/forum/general/please_fix_my_wxwidgets_problem

And on StackExchange: https://stackoverflow.com/questions/75523269/using-notebooks-with-splitters-in-wxwidgets
Because this was a different problem, actually, which just happened to also use wxWidgets.
So it wouldn't have been appropriate to post about your new problem in a thread titled "PLEASE fix my wxWidgets problem?"

Or ask your new problem on StackOverflow first instead of GOG forums?
Post edited April 20, 2023 by lupineshadow
First of all, I specified that it's a notebook problem, meaning a problem with the notebook control, which the other one wasn't. Second of all, this is the general discussion, which can be about anything. Third of all, I can't seem to get Stack Overflow to work right now, and in any case, the people there always tend to be jerks, and people here are typically much more helpful.