kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37157
Re: [PATCH] RFC: toolbar button support for action plugins
чт, 16 авг. 2018 г. в 12:26, Andrew Lutsenko <anlutsenko@xxxxxxxxx>:
> If icon file doesn't exist or can't be loaded (wrong format for example)
> pcbnew will throw an error message
> and will continue with no button for that plugin and generic hammer icon
> in menu.
>
Hi Andrew!
I think will be better to add the separate option that will controls
visibility of plugin on toolbar. For example:
import os
import pcbnew
import wx
class Plugin1(pcbnew.ActionPlugin):
def defaults(self):
self.name = "Dummy Plugin 1"
self.category = "Read PCB"
self.description = ""
*self.show_on_toolbar = true*
self.icon_file_name = os.path.join(os.path.dirname(__file__),
'icon.png')
def Run(self):
wx.MessageBox("Plugin 1")
Plugin1().register()
Also, probles with icon don't must take affect on visibility of toolbar
button. Just use default icon.
Anyway, good work. Thanks.
Follow ups
References