Author Topic: How to define new frame type in wxSmith? To add a worker thread.  (Read 3236 times)

Offline paddle

  • Single posting newcomer
  • *
  • Posts: 8
Using codeblocks17.12 + wxwidgets 3.1.2 + wxsmith project template.

I need to add a worker thread as discussed on this wxwidget forum topic : https://forums.wxwidgets.org/viewtopic.php?f=1&t=46472

Someone supplied me a demo, but writen on raw wxwidgets. As I am using wxsmith there are some structure differences that makes things different.

One issue is that the demo declares a new frame type deriving from wxFrame, in which he adds a thread class.

My issue is that on wxSmith template created by the CodeBlocks new wxwidgets project, I can't find where the frame class is defined.

In XxxApp.cpp (where Xxx is the project name) there's :

Code
XxxFrame* Frame = new XxxFrame(0);

But I cannot find where the XxxFrame is defined.

In XxxMain.cpp there's :

Code
//(*InternalHeaders(XxxFrame)
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(XxxFrame)
const long XxxFrame::ID_PANEL1 = wxNewId();
const long XxxFrame::idMenuQuit = wxNewId();
const long XxxFrame::idMenuAbout = wxNewId();
const long XxxFrame::ID_STATUSBAR1 = wxNewId();
//*)

XxxFrame::XxxFrame (wxWindow* parent,wxWindowID id)
{
...
But nothing like :

Code
class XxxFrame : public wxFrame
{
public:
    ...
};
How can I add some changes to the Frame class to add my thread class?

Alternatively, if someone have a demo for a wxsmith project with a worker thread that would be really awesome.

Thanks!
« Last Edit: October 30, 2019, 05:46:03 pm by paddle »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: How to define new frame type in wxSmith? To add a worker thread.
« Reply #1 on: October 30, 2019, 05:43:07 pm »
The frame is defined in XxxMain.h

Offline paddle

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to define new frame type in wxSmith? To add a worker thread.
« Reply #2 on: October 30, 2019, 05:49:06 pm »
Thanks!