PDA

View Full Version : Target enumerations


Snakebite
October 13th, 2002, 03:55 PM
I have a suggestion for the next version of the plugin API.

My plugin would benefit from better access to the target of commands. Today, my plugin can only enumerate targets of it's own commands. Also, today the assumption is that targets are only enumerated during the *execution* of a command.

I suggest a function like target_enum that will take the id of *any* command, not restricted to the commands of my plugin, and callback a function in my plugin.

I also suggest a function like the above, but that will assume the target of the currently selected command. That way, the settings dialog can make use of the current command's target while the settings are being edited. That is, one should not have to save the command before the targets can be enumerated.

Also, don't forget my suggestion to send state information to the callback function! I hate globals. :)

So when can we see this added to the API? :)

Snakebite
October 13th, 2002, 03:55 PM
Shoot! I was trying a work-around and saw that I don't have access to the id-number of the current command. I was going to use trigger_command to force a target_enum for the current command.. not possible without the id. Hrmpf... :evil: That's another suggestion to the next API. :)

Ron
October 13th, 2002, 03:55 PM
1. The ID that is required is the ID of the plugin, not of the command.

2. I did not forget your suggestion, if you take a look at the todo.txt you'll find it in there.

3. I will not have time to work on Girder for a few weeks. So don't hold your breath.

Snakebite
October 13th, 2002, 03:55 PM
1. The ID that is required is the ID of the plugin, not of the command.


For target_enum, yes, this is what I suggest is changed. It's for trigger_command I would need the id of the current command.

Take your time!