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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » simple TopWindow... branch GUI_APP_MAIN
Re: simple TopWindow... branch GUI_APP_MAIN [message #227 is a reply to message #212] Sun, 04 December 2005 19:01 Go to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
fudadmin wrote on Sat, 03 December 2005 08:14


4. a) "title1 Window, setRect" this way doesn't work:

#include <CtrlLib/CtrlLib.h>

GUI_APP_MAIN
{
    TopWindow().Title("title1").SetRect(0, 0, 260, 80).Run();  // should create window and its title, open and start pumping messages... but
//error C2228: left of '.Run' must have class/struct/union type
        type is 'void'
}


Why? I don't know. We need to ask the creators...



Because SetRect is method of Ctrl, not TopWindow and it returns "void". Therefore:

TopWindow win;
win.Title("Title");
win.SetRect(0, 0, 260, 80);
win.Run();

Actually, what methods are supposed to return *this for method chaining is debatable. Usually they are "property" methods (or "modifiers") that are used to setup some initial state.
 
Read Message
Read Message
Next Topic: simple TopWindow... branch classWindow : TopWindow
Goto Forum:
  


Current Time: Sun Aug 24 00:11:53 CEST 2025

Total time taken to generate the page: 0.02591 seconds