Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Using a Button to load a window/form using Run.  THISBACK syntax  
	
		
		
			| Using a Button to load a window/form using Run.  THISBACK syntax [message #44352] | 
			Fri, 27 February 2015 22:33   | 
		 
		
			
				
				
				  | 
					
						  
						Edward
						 Messages: 34 Registered: February 2015  Location: United States
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		I'm trying to load a layout with the push of a button. 
 
The layout loads here as expected in GUI_APP_MAIN. 
GUI_APP_MAIN
{
	Form1().Run();   // ***** Displays Form 1 perfectly ****
	//Form2Dlg().Run();  // ***** Displays Form 2 perfectly **** <<- Push button control
} 
 
But I can't get the Button coding syntax working.  Haven't found THISBACK instructions or example syntax. 
 
Here is my full .CPP code: 
#include "Form1.h"
//****** Pasted struct code here, from code generator **********
struct Form2Dlg : WithForm2Layout<TopWindow> {
	typedef Form2Dlg CLASSNAME;
	Form2Dlg();
};
Form2Dlg::Form2Dlg()
{
	CtrlLayout(*this, "Form 2");
}
//------------------------
Form1::Form1()
{
	CtrlLayout(*this, "Form 1");
}
//-----------------
class Form1Dlg : public WithForm1Layout<TopWindow> {
	typedef Form1Dlg CLASSNAME;
	void Btnform2();
public:
	Form1Dlg();
};
Form1Dlg::Form1Dlg()
{
	CtrlLayout(*this, "Form 1");
	btnForm2 <<= THISBACK(Btnform2); // Pushing button to invoke Btnform2 function
}
void Form1Dlg::Btnform2() // Display Form 2 function
{
	Form2Dlg().Run();
}
GUI_APP_MAIN
{
	Form1().Run();   // ***** Displays Form 1 perfectly ****
	//Form2Dlg().Run();  // ***** Displays Form 2 perfectly ****
} 
 
Any guidance appreciated 
		
		
  My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
		[Updated on: Fri, 27 February 2015 22:56] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
  
 
Goto Forum:
 
 Current Time: Tue Nov 04 06:58:17 CET 2025 
 Total time taken to generate the page: 0.05571 seconds 
 |