I'm working through creating a button in the Document Properties dialog to fit the canvas around the current selection or the full drawing. You can read a diff of my changes at:
http://www.ekips.org/comp/inkscape/inx/current.diff
I'm at the point now where I would like to hook the function up to the button. The question is how to best do this.
Do I create a Verb and hook it up through there? If so, where can I find an example of how to use a verb with a button on a dialog? I noticed that very few functions in Inkscape actually get to be Verbs. Should there be more verbs? From where should a verb get access to the active desktop/document?
Should I use sigc::bind() to pass the active desktop to the function directly in the dialog code? If so from where should I get a pointer to the current desktop? While I was looking around document-properties.cpp for a pointer to the active desktop, I found "static void on_activate_desktop (Inkscape::Application *, SPDesktop* dt, void*);". Some of the params aren't named. And while the desktop is named dt, it is never used. SP_ACTIVE_DESKTOP is used instead. Is SP_ACTIVE_DESKTOP evil?
Needless to say, I'm a little confused and I don't know what questions to ask to get the answers. I just want to hook my little button up the right way.
Aaron Spike