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   |
 |
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, , 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();
}
|
|
|
|
 |
|
What Label.WhenAction supposed to do? - nothing [PARTLY SOLVED :)]
By: fudadmin on Mon, 20 March 2006 08:01
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Mon, 20 March 2006 09:10
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Wed, 22 March 2006 17:24
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Wed, 22 March 2006 17:34
|
 |
|
Re: What Label.WhenAction supposed to do?
By: fudadmin on Wed, 22 March 2006 19:47
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 00:05
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Fri, 24 March 2006 09:20
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 10:11
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 10:52
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Fri, 24 March 2006 11:01
|
Goto Forum:
Current Time: Sun Jun 08 02:17:17 CEST 2025
Total time taken to generate the page: 0.19947 seconds
|