Tux Guitar

Open Discussion

Subject Adding a toolbar from a plugin



Author Message
nicolas [at] vizille.net
Post: Oct 23rd 2009 at 1:46 AM

My special use of tuxguitar require some extra features. Since I want to code it "clean", I'm trying do do some plugins. It works quite well.

I still have a problem: I don't understand how to add a toolbar from a plugin. It's really difficult to me, since I always have to "reverse-engineer" the structure of TG, and java is not my native language...

Do you have some idea, (or even better: sample code / sample plugin) about how to that?

Thanks man, you rock!


Back to Top
 
Julian
Post: Oct 24th 2009 at 12:24 PM

Currently is not supported that a plugin adds dynamic tool/menu item.
You can see menu, on known actions if you make a Tool plugin, it creates a menu item at Tools menu, but there is nothing to say "i want a menu item at Beat" yet.. same for toolbar.

You can yes, access the SWT CoolBar instance, and manually add it where you want.
But tuxguitar will override your changes if user change the skin, or any toolbar configuration.

to get the Coolbar:
TuxGuitar.instance().getItemManager().getCoolbar()

Then on the Coolbar you have to add new CoolItems, containing Toolbars, or iterate the Coolbar children to use any existent one.
See at ItemManager, how the coolbar is generated.


Back to Top