Skip to content

Creating Applications

pushkar edited this page Feb 18, 2011 · 3 revisions

Create the following main file for your custom application. This file runs RST and includes custom tabs.

#include "EmptyTab.h"

extern wxNotebook* tabView;

class MyApp : public RSTApp {
	virtual void AddTabs() {
		// Add tabs here. Example:
		tabView->AddPage(new EmptyTab(tabView), wxT("EmptyTab"));
	}
};

IMPLEMENT_APP(MyApp)

Compiling

Windows

Create a Visual studio project including the following settings:

Additional Include directories: C:\wxWidgets\include; C:\wxWidgets\lib\msw; <RST_DIR>\librst; <RST_DIR>
Additional Library directories (Debug): C:\wxWidgets\lib; <RST_DIR>\win32\Debug
Additional Library directories (Release): C:\wxWidgets\lib; <RST_DIR>\win32\Release
Additional Dependencies (Debug): librst.lib; wxmsw28d_gl.lib; wxmsw28d_core.lib; wxbase28d.lib; wxtiffd.lib; wxjpegd.lib; wxpngd.lib; wxzlibd.lib; comctl32.lib; rpcrt4.lib;
Additional Dependencies (Release): librst.lib; wxmsw28_gl.lib; wxmsw28_core.lib; wxbase28.lib; wxtiff.lib; wxjpeg.lib; wxpng.lib; wxzlib.lib; comctl32.lib; rpcrt4.lib;

where <RST_DIR> is the directory of your local RST repository.

Linux

New project can be compiled with CMake. Create a CMakeLists.txt file. Include the librst folder. Include the path to the rst static library.

include_directories(../../librst ../../)
set (CMAKE_CXX_FLAGS "-L../../librst")

Include all files in the CMake for compiling and compile with wxWidgets and the static librst.

set ( SRC EmptyTab )

set (wxWidgets_USE_LIBS base core gl)
find_package (wxWidgets)
if (wxWidgets_FOUND) 
  include (${wxWidgets_USE_FILE})
  add_executable (EmptyTab  ${SRC})
  target_link_libraries (EmptyTab rst ${wxWidgets_LIBRARIES})
else (wxWidgets_FOUND)
  message ("wxWidgets not found!")
endif (wxWidgets_FOUND)

Since the project links with librst statically, you will have to recompile librst everytime a change is made in RST. If the functionality of your project is changed, compile the project with

    cmake .
    make
Clone this wiki locally