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 » Community » Newbie corner » How to use callbacks
Re: How to use callbacks [message #45867 is a reply to message #45865] Fri, 15 January 2016 20:12 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1204
Registered: August 2007
Senior Contributor
In order to use THISBACK macro(s), which actually expands to callback(this, &CLASSNAME::foo) and other variants, where foo should be a method (memeber) of the CLASS pointed with "this" pointer, you simply need to add the following line to your class' declaration.

typedef Saisie CLASSNAME;


Now, of course you can also use a (1) non-member function as a callback or a (2) public method of another object, without defining a CLASSNAME (type).

E.g.,


1) callback(&foo)

2) callback(&cpp_object, &other_cpp_object::foo)



See U++ documents and reference examples (there is a "Callback" named example code in reference examples.)

Regards,

Oblivion



[Updated on: Fri, 15 January 2016 20:38]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: PlotCtrl in upp-x11-src-9360.tar.gz missing
Next Topic: Empty Template vs CtrlLib application with main window
Goto Forum:
  


Current Time: Mon May 05 09:40:08 CEST 2025

Total time taken to generate the page: 0.02948 seconds