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++ Widgets - General questions or Mixed problems » What Label.WhenAction supposed to do? - nothing [PARTLY SOLVED :)]
Re: What Label.WhenAction supposed to do? [message #1841 is a reply to message #1804] Wed, 22 March 2006 17:24 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

the code you have posted was very important for me. I'am new of C++ and Ultimate++, but I've some experience with GUI using C API (Motif for example under Unix). Your code reminded me more or less what I've usually done in C style without to declare any class. Just each widget is child of someother and there are callback attached to them. I understand that the class method is elegant and powerful, but I'm a lazy man, Embarassed , and I do not want to loose time with C++ and its intricasy (at least not now). So your approach for me was a surprise and showed that, perhaps, I can program in a sort of C style.
I would like to know, before to start to port one my program in U++ (the wich GUI is in C), if the approach you have showed could break at some moment, for example in complex interface. In other term, is it mandatory to implement class/es to let a GUI interface to work, or can I live without them in Ultimate++?
In case I can avoid the class I would like to see your code, or a similar one, in the documentation to let know to the beginner how it is easy to program with Ultimate++ in contrast with other GUI toolkits.

Luigi

fudadmin wrote on Mon, 20 March 2006 02:01

#include <CtrlLib/CtrlLib.h>

void testAction()
{ PromptOK("testLabelAction");
}

GUI_APP_MAIN
{
	TopWindow w;
	Button b;
	Label l;

	w.Add(b);

	b.SetLabel("button - testAction");
	b.SetPos(b.PosLeft(10, 100), b.PosTop(10, 30));	
//	b.WhenPush=callback(testAction);  //both work
	b.WhenAction=callback(testAction);
	
	w.Add(l);
	l.SetLabel("label - testAction");
	l.SetPos(l.PosLeft(150, 100), l.PosTop(10, 30));
	l.WhenAction=callback(testAction);	
	
	w.Run();
}




 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CtrlLayoutOKCancel - detecting Cancel vs Bad input?
Next Topic: 603.r9 TreeCtrl etc. repaint optimization [BUG?]-No,feature.ParentCtrl and Ctrl
Goto Forum:
  


Current Time: Sun Jun 08 02:35:59 CEST 2025

Total time taken to generate the page: 0.07579 seconds