[gtkmm] Write a class that uses internally gtkmm 2.x(linux) and winapi(windows)



Hi,

i want to try writing a class, that can i use under windows and linux without changing the programm code.
And that uses the nativ funktions of the OS gui api(e.g. gtkmm 2.x(linux) and winapi(windows).

So that i can use the class e.g:

#include <myclass.h>

int main(int argc, char *argv[])
{
	myInit(argc,argv); //<--- this doesn't work i have to use
 			   //	  Gtk::Main kit(argc,argv) instead
	
	myWindow win;

	myRun(win);
}


I have already wrote a simple class, with that i can reate a simple Window with an button on it.
But i havn't yet found out how i can use the Gtk::Main object in may class.
When i try to create the Gtk::Main object(Gtk::Main kit(argc, argv);) not in the main fkt. of the programm i become a Memory access error (that is right, because the object will be destoryed when the fkt. is left).

I tried it also to make the Gtk::Main object global in my main code of the class. But if i made it so i become the error that Gtk::Main::Main() is protected.

so is it possible to write a class that uses internally on linux gtkmm 2.x or must i write it in pure gtk+ 2.x??

if , how??


stephan

----------------------------------------------------------------------
I hope you understand my questions, becaus my english isn`t so good :)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]