Hi Pete!
I got busy myself with GetN macros, and think I understand something
about, how it works.
So perhabs I can helb you.
When putting: GETN_OPTION_BRANCH(GETN_BRANCH_OPEN)
in your code, there will be created an Attribute for this TreeNode, by calling method: SetAttribute()
You can then get this Attribute by using method: GetAttribute()
int save_state_collapsible_ex() {
GETN_TREE(myTree)
GETN_BEGIN_BRANCH(clientData, "Collapsible Branch") GETN_OPTION_BRANCH(GETN_BRANCH_OPEN)
GETN_STR(name, "Name", "Enter name")
GETN_STR(adress, "Adress", "Enter adress")
GETN_STR(contact, "Contact", "Enter contact")
GETN_END_BRANCH(clientData)
// This code will be execute when pressing "OK" button
if( GetNBox(myTree, "Client Data", "Input client data") ) {
int collap;
if ( myTree.GetAttribute("Branch", collap) ) { // dont know exactly if Attribute is named "Branch"
// but you can check it in debug mode
out_str("Found Attribute: " + collap);
return collap;
}
else {
out_str("Could not find Attribute!");
return -1;
}
}
}
I dont know exactly how the Attribute is called. But you can check it
up in debug mode, viewing the TreeNode of your branch.
It has more than one Attributes. One is called "NodeID", another called "Label". And there must be created one, where the value of your collapsible option is saved.
You can get this value like in the example above. This method GetAttribute() awaits two parameters. The Attribute name, and a variable where to put the value.
The way how you export this value, and where, to use it for whatever you want it, you have to think about yourself! ;D
Hope I could help you!
greetz
<!-- helping each other is a good thing...like TreeNode holding the branches and leaves of a Tree -->