From: Abraham S. <ab...@cn...> - 2004-08-16 20:07:04
|
What might be a cool extension on this idea, would be the ability to specify 'plugin' actions to add to the toolbar: toolbar.buttons : (name, tooltip, image, function), (name, tooltip, image, function) The difficulty would specifying which modules to load. One simple approach might be to have a directory called 'plugins', in which all modules automatically get loaded. I think this would take about the same amount of code as hard-coding a single printer option in, and might allow more flexibility (easier to add/remove buttons, and easier to change what action they perform). I wrote a quick patch (attached to the email) which allows for two new rc params: plugins.directory : <directory> any file in this directory ending in '.py' is automatically imported toolbars.buttons: (name, tooltip, image, function), ... a list of the tuples is created I didn't edit any of the backend code yet, but it should be trivial (at least in the case of the gtk backend) to convert 'toolitems' to an array, and then "if matplotlib.rcParams['toolbar.buttons']: toolitems.extend(matplotlib.rcParams['toolbar.buttons'])" Abe John Hunter wrote: >>>>>>"Steve" == Steve Chaplin <ste...@ya...> writes: >>>>>> >>>>>> > > Steve> Perhaps the .matplotlibrc file could have lines like > Steve> printcommand: None printcommand: '"lpr %s" % path' And if > Steve> printcommand is not None an extra toolbar button is created > Steve> which calls os.system(printcommand) to print the file. > >This is a good idea, perhaps the rc param should be >savefig.printcommand. There was a post on the users list which >contained some help on how to print from wx on win32. > >Anyone want to take the lead here? > >JDH > > >------------------------------------------------------- >SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media >100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 >Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. >http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 >_______________________________________________ >Matplotlib-devel mailing list >Mat...@li... >https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > |