BCS c++ MainWin Utility


The need to senselessly fit many of the GTKMM examples has required me to create and additional module.
[codesyntax lang=”cpp”]

int tvcl::MainWin(int argc, char* argv[]){
	auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); // @suppress("Invalid arguments")
	ExampleWindow window; // @suppress("Type cannot be resolved")
	//Shows the window and returns when it is closed.
	return app->run(window); // @suppress("Method cannot be resolved")
}

[/codesyntax]
The interface to this module would appear as depicted below.
[codesyntax lang=”php”]

/**
 * tv02h.h
 *
 *  Created on: Thursday April 12, 2018
 *  @author    Author: Mr. Arch Brooks
 */
#ifndef TV02H_H_
#define TV02H_H_
#include <boost/algorithm/string/replace.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <string>
using namespace std;
const int sizeOfStringArray = 1000;
/**
 * This is some test Doc Text
 */
class tvcl {
/**
 * Private  Declarations Go Here
 */
private:
/**
 * Public  Declarations Go Here
 */
public:
	int MainWin(int argc, char* argv[]);
	int fin(string, string[]);
	void fot(string otf, string stv[sizeOfStringArray], int cnt);
	void fileCopy(string fin, string fot);
	bool forceDirectories(string path);
};
#endif /* TV02H_H_ */

[/codesyntax]
Of course the MainWin is the featured interface for he proceeding implementation of MainWin.
Once this is in place you simply create the windowexample.h and the windowexample.cpp files so the example may be easily pasted over and execution of the targeted example is expedited.
Our main program is depicted below.
[codesyntax lang=”cpp”]

//============================================================================
// Name        : tv02p.cpp
// Author      : Mr. Arch Brooks
// Date        : Thursday April 12, 2018
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
/*! \mainpage My Personal Index Page
 *
 * \section intro_sec Introduction
 *
 * This is the introduction.
 *
 * \section install_sec Installation
 *
 * \subsection step1 Step 1: Opening the box
 *
 * etc...
 */
#include <iostream>
#include "tv02h.h"
//#include "examplewindow.h"
using namespace std;
//ExampleWindow ew;
tvcl tv;
int main(int argc, char* argv[]) {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	tv.MainWin(argc, argv);
	return 0;
}

[/codesyntax]
This approach allows me to rapidly execute example gtkmm source code.
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *