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 » TreeCtrl » OptionTree loses check state when add Callback for the option.
icon1.gif  OptionTree loses check state when add Callback for the option. [message #37576] Fri, 19 October 2012 15:18 Go to next message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
index.php?t=getfile&id=3898&private=0


Add(horz.Horz().SizePos());
optree.SetRoot("Parent");

optree.Add(0,x[0],"a");
optree.Add(0,x[1],"b");
optree.Add(0,x[2],"c");
optree.Open(0);
		
//if i add below Callback function,the ParentOption`s checkstate //will lose
x[0] <<= THISBACK(OnOption1);

index.php?t=getfile&id=3897&private=0
Re: OptionTree loses check state when add Callback for the option. [message #37700 is a reply to message #37576] Sun, 04 November 2012 09:12 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
It is because the WhenAction of Option is used by OptionTree to do the work. So if you replace it with your own callback, nothing happens.

Use operator<< to add callback instead of replacing it:

x[0] << THISBACK(OnOption1);


Mirek
Previous Topic: Change font color in TreeCtrl
Next Topic: Cannot scroll selected node into view from code [SOLVED]
Goto Forum:
  


Current Time: Thu Apr 18 15:32:56 CEST 2024

Total time taken to generate the page: 0.01436 seconds