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! » How to call the methods of a class from another class
How to call the methods of a class from another class [message #2274] Wed, 05 April 2006 17:44 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
The game is becoming hard. I need some interaction among widgets. The following problem is more general of what may appear.

The problem: in our class App we have a menu, status bar and 3 tabs. In particular the status bar has the InfoCtrl info1 that it is time begin to work (a lazy man can't see other doing nothing Smile ).

I would like that it shows the number of the records added in the arrayctrl. So I did the following (naive) steps:

1. define a method in class App able to modify the info1 ctrl:

     void UpdateInfo(String s)  { info1 = s;}


It works when it is called from inside the class App (by the way, the operator <<= now doesn't work with info1, is it normal?).

2. At the end of the method AddPlayer() I have added the line:
     App.UpdateInfo(" from tab1!");


3. run

Surprised ... the compiler start to cry and complain as I were a criminal. Now that I was enjoing with C++ something happened. Who knows how to let the things work?

Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: "Forlano tabs" - fill EditFields from ArrayCtrl Row...
Next Topic: How to create a modal dialog
Goto Forum:
  


Current Time: Sat Apr 27 11:43:25 CEST 2024

Total time taken to generate the page: 2.97541 seconds