// The `main program' equivalent, creating the windows and returning the // main frame bool MyApp::OnInit() { // Create the main frame window MyFrame* frame = new MyFrame(NULL, _T("Tree Test"), wxDefaultPosition, wxSize(400, 550)); #if wxUSE_STATUSBAR // Give it a status line frame->CreateStatusBar(2); #endif // wxUSE_STATUSBAR // Give it an icon #ifdef __WINDOWS__ wxIcon icon(_T("tree_icn")); frame->SetIcon(icon); #endif // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(TEST_LEFT_RIGHT, _T("&Left to right"), _T("Redraw left to right")); file_menu->Append(TEST_TOP_BOTTOM, _T("&Top to bottom"), _T("Redraw top to bottom")); file_menu->AppendSeparator(); file_menu->Append(TEST_QUIT, _T("E&xit"), _T("Quit program")); wxMenu *help_menu = new wxMenu; help_menu->Append(TEST_ABOUT, _T("&About"), _T("About Tree Test")); wxMenuBar* menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); MyCanvas *canvas = new MyCanvas(frame); // Give it scrollbars: the virtual canvas is 20 * 50 = 1000 pixels in each direction canvas->SetScrollbars(20, 20, 50, 50); frame->canvas = canvas; myTree = new wxTreeLayoutStored(); wxClientDC dc(canvas); wxFont font(10, wxROMAN, wxNORMAL, wxBOLD); dc.SetFont(font); TreeTest(*myTree, dc); frame->Show(true); #if wxUSE_STATUSBAR frame->SetStatusText(_T("Hello, tree!")); #endif // wxUSE_STATUSBAR // Return the main frame window return true; }
int main(int argc, char* argv[]) { IupOpen(&argc, &argv); IupControlsOpen(); TreeTest(); IupMainLoop(); IupClose(); return EXIT_SUCCESS; }
void DirTest (void) { Simple(); TreeTest(); // SeekTest(); }