Removing and Adding Toolbar Buttons

Discussion about writing code for Inkscape.
User avatar
LiquidAsh
Posts: 71
Joined: Fri Apr 22, 2011 11:35 pm
Contact:

Removing and Adding Toolbar Buttons

Postby LiquidAsh » Sat Apr 23, 2011 12:05 am

Hello, I've enjoyed using Inkscape for several years. I'd now like to try customizing the interface. In particular, I'd like to remove some of the default buttons from the toolbar, and add some new ones in their place. I have downloaded and built the source code for Inkscape, but thought it might be worth asking for any advice or direction anyone can offer. Thanks in advance for any direction or help you can offer.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Removing and Adding Toolbar Buttons

Postby ~suv » Sun Apr 24, 2011 10:06 pm

LiquidAsh wrote: I'd now like to try customizing the interface. In particular, I'd like to remove some of the default buttons from the toolbar, and add some new ones in their place.

Could you explain what your goal is? Do you want to change the icon (image) of the buttons, or do you indeed want to write code for new functions and make those functions available as a new button on one of the toolbars?

Note that just changing the icon/image used for the buttons does not require to recompile Inkscape (those images are loaded at runtime) - if you tell us on which platform you use Inkscape, we can provide you with detailed steps how to make Inkscape load the icons from a custom resource file.

User avatar
LiquidAsh
Posts: 71
Joined: Fri Apr 22, 2011 11:35 pm
Contact:

Re: Removing and Adding Toolbar Buttons

Postby LiquidAsh » Mon Apr 25, 2011 1:04 pm

Thanks for the response ~suv.

First, I'd like to remove some of the buttons to simplify the interface a bit. Second, I'd like to add new functionality behind a couple of new buttons: things like set the linear curve tool with 2px wide green stroke settings.

I'm building with the buildtool.cpp app compiled with MinGW32 under Windows7.

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Removing and Adding Toolbar Buttons

Postby Simarilius » Tue Apr 26, 2011 12:54 am

Toolbox.cpp would be a good place to start if I remember right (not at home so no access to the code) the othe files you may want will be the context files, so select-context.cpp for the select tool, these should all be in the main src directory unless someones be rearranging again.
If u have code questions the chartroom may get u instant answers, or the dev mailing list is a good place to go, most of the devs read it to some level.

User avatar
LiquidAsh
Posts: 71
Joined: Fri Apr 22, 2011 11:35 pm
Contact:

Re: Removing and Adding Toolbar Buttons

Postby LiquidAsh » Tue Apr 26, 2011 10:46 am

Thanks Simarilius, I'll definitely give those context files a look, and direct future code questions to the jabber/irc chatrooms.
P.S. sorry about the double post... I didn't remember seeing the admin approval message after quick replying the first time. I'll see whether I can edit that.

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Removing and Adding Toolbar Buttons

Postby Simarilius » Wed Apr 27, 2011 12:56 pm

Feel free to continue to ask here, just be aware that a lot less devs will see it here. The things your wanting to do don't sound overly difficult.


Return to “Programming”