Multiple source files with a GUI

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
Dragon1898
In need of some credit
In need of some credit
Posts: 1
Joined: Mon Jun 11, 2018 2:36 pm

Multiple source files with a GUI

Post by Dragon1898 »

Hi all,
I'm trying to write a client/server program with a GUI using wxWidgets. What I want to happen is when I run the executable, I can click in a button and the client and sever files will run. I've already written a working client and server files and I made the GUI, what I'm having trouble with is getting these files to link to the GUI. Does anyone know how to make this work? The client and server files are source files not header files, do I need to change this?
Thanks for all the help!
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Multiple source files with a GUI

Post by eranon »

Hello, Typically, you separate any class's implementation (in .cpp file) from its declaration (in .h file) to be able to reference it from outside. If your overall app is in one single file, you don't need any separation, but it's only applicable for tiny tool (to stay clear, I mean). So, it's better to separate your GUI (ie. wxFrame or wxDialog based) class in .cpp and .h files (eg. myframe.cpp and myframe.h), then #include the header where required (eg. from, say, app.cpp, during app init handler).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply