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 » TreeCtrl - how to change images dynamically? [SOLVED + FIXED]
Re: TreeCtrl - how to change images dynamically? [message #2335 is a reply to message #2331] Sat, 08 April 2006 14:05 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
fudadmin wrote on Sat, 08 April 2006 07:00

luzr wrote on Sat, 08 April 2006 11:42

const Node& GetNode(int id) const;
void SetNode(int id, const Node& n);

What do you mean by "series of images"?

Mirek


I had tried this unsuccessfully... That's why I asked.
	tree.SetNode(editid, tree.GetNode(editid).SetImage(CtrlImg::ImgEdit()));

E:\AriUppApps1\ideAris1\main.cpp(26) : error C2662: 'TreeCtrl::Node::SetImage' : cannot convert 'this' pointer from
'const TreeCtrl::Node' to 'TreeCtrl::Node &'



Ah... Well, one of rare cases when C++ does not play well...

Try

TreeCtrl::Node n = tree.GetNode(editid);
n.SetImage(CtrlImg::ImgEdit());
tree.SetNode(editid, n);


Thinking about it, it would probably be better here to return Node value instead of constant reference... what do you think? (Constant reference is faster, however in this case it is very likely you are about to change the value in most cases).

MIrek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TreeCtrl - how to set horizontal grid? [NEEDS IMPLEMENTATION...]
Next Topic: Missing callback trigger in OptionTree? [SOLVED/FIXED]
Goto Forum:
  


Current Time: Sun May 19 10:42:16 CEST 2024

Total time taken to generate the page: 0.01458 seconds