wxTextCtrl *textControl = new wxTextCtrl; //Define the new textCtrl
textControl = new wxTextCtrl(this, ID_TextBox,
wxT(""), wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_RICH , wxDefaultValidator, wxTextCtrlNameStr); //Creates a text box, with no text, id=ID_TextBox, it's multiline
wxMenu *menuFile = new wxMenu; //Create a new menu to be placed on a menu bar
menuFile->Append( ID_About, _("&About...") ); //Add the first option to the menu (will show up on top)
menuFile->AppendSeparator(); //Add a separator, this is handy
menuFile->Append( ID_Quit, _("E&xit") ); //Add an option to the menu
wxMenuBar *menuBar = new wxMenuBar; //Create a new menu bar
menuBar->Append( menuFile, _("&File") ); //Append the file menu
SetMenuBar( menuBar ); //Defines the window menu bar to menuBar
Maximize(); //Maximizes the window
all:
@echo "** Building..."
g++ -c `wx-config --cppflags` helloworldgui.cpp -o helloworldgui.o
@echo "** Linking/creating executable..."
g++ `wx-config --libs` helloworldgui.o -o helloworld
clean:
@echo "** Removing object files and executable..."
rm -f helloworldgui.o helloworldgui
install:
echo '** Installing (why in the world do you want to install this??)...'
cp helloworldgui /usr/bin
uninstall:
@echo '** Uninstalling...'
rm /usr/bin/helloworldgui
Make a file called Makefile, copy+paste the above stuff into it, and save it in the same dir as helloworldgui.cpp.make
./helloworldgui
g++ helloworldgui.cpp `wx-config --cxxflags` `wx-config --libs`
./a.out
Hum, that sounds too complicated, here's my option:bleh... remember that Linux has no extensions for shell scripts or binaries! :PCode: [Select]g++ helloworldgui.cpp `wx-config --cxxflags` `wx-config --libs`
./a.out
Save it as compile.sh or whatever and build+run by doing sh compile.sh.
But I guess that has more options, but for developing it, I used this.
g++ helloworldgui.cpp `wx-config --cxxflags` `wx-config --libs` -o helloworldgui
./helloworldgui
...since you know exactly what was compiled. If you had many object files, it wouldn't be very pretty with all of them writing to ./a.out! :PIf its an sh file can't it only be run in Linux. alberthrocks method would be multiplatform I believe
Actually, I don't think /usr/bin exists in Windows for software, or does it?Scout's right on this one - the make install rule will not work on Windows. But, the makefile works on all platforms (assuming GCC is in the PATH on Windows) due to the "make" binary being cross-platform.
g++ `wx-config --libs` helloworldgui.o -o helloworld
tog++ `wx-config --libs` helloworldgui.o -o helloworld.exe