PDA

View Full Version : semantics of set_command(...)


Snakebite
October 13th, 2002, 03:55 PM
Hi,

just looking for a clarification. What identifies the command that set_command(...) updates? Is it the pointer of the command parameter, or is it the command current in the config dialog, i.e. the last command from command_changed(...)?

I'm doing some OO wrapping, so this becomes important. In other words, if I store a pointer (A) from an earlier command_changed(...) and then call set_command(A) later, after the user has selected another command (B), which one is updated?

Ron
October 13th, 2002, 03:55 PM
Currently Girder always passes the same pointer to the plugin (one for the user node selects and one for the events). If the user selects a new node on the treeview, girder copies the command structure to the plugin command structure and notifies the plugin that it has been updated. All the old PCHARs and PVOIDs are now invalid. Re-read the structure to find the new pchars.

If you call set_command you must pass the pointer that Girder gave you in command_changed.

Does this make it a little bit clearer ?

note: if you want to modify the command structure make sure you are in a critical section.

Snakebite
October 13th, 2002, 03:55 PM
Perfectly clear, thanks!