Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » THISBACK1 works well, how can i make it with lambda
THISBACK1 works well, how can i make it with lambda [message #48319] Thu, 22 June 2017 03:41 Go to previous message
MuratAKAR is currently offline  MuratAKAR
Messages: 3
Registered: June 2017
Junior Member
First of all, I would like to thank all the developers.

I have a form with 100 button. When i click a button, its Label change to "X". I made it with THISBACK1. How can i make it with lambda.
index.php?t=getfile&id=5312&private=0

class AnaForm: public WithAnaFormGUI<TopWindow>
{
	Button butonlar[100];
	void btnDuzenle(Button*);
	typedef AnaForm CLASSNAME;
public:
	AnaForm();
};

void AnaForm::btnDuzenle(Button* btnDuzenle)
{
	btnDuzenle->SetLabel("X");
}

AnaForm::AnaForm()
{
	CtrlLayout(*this, "Deneme");

	for(int i=0;i<100;i++)
	{
		butonlar[i].LeftPosZ(i%10*30,28).TopPosZ(i/10*30,28);
		butonlar[i].SetLabel(String()<<i);
		Add(butonlar[i]);
		
		butonlar[i]<<THISBACK1(btnDuzenle, &butonlar[i]); //this works well

		butonlar[i]<<[](){ //How can i make it with lambda
			
		};
	}
}


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: callbacks freeze gui
Next Topic: About storing references and pointers to callbacks.
Goto Forum:
  


Current Time: Thu Mar 28 18:27:03 CET 2024

Total time taken to generate the page: 0.01945 seconds