|
From: Daniel J S. <dan...@ie...> - 2014-10-28 09:41:16
|
On 10/27/2014 01:53 PM, Ethan A Merritt wrote: > I also have code to add save-to-png-file to the wxt toolbar. > But I haven't worked with this toolkit before and I haven't found a > decent worked example to show how to embed this in a pull-down menu. > So as before ... > >> Patches welcome. I've placed a patch here: https://sourceforge.net/p/gnuplot/patches/704/ Give that a try. All you need to do is put your code for saving as PNG or whatnot in the location provided in the new switch statement. You may also want to tweak things, e.g., change the filters to whatever files you can save as. This is slightly different than the way Qt behaves as far as picking a file format. It's done via the file dialog's filter feature. It makes for a more conventional method of choosing, and in fact makes for easier programming versus putting a dropdown menu associated with the toolbar button. I suggest adding your code and moving into the repository then let people compare/experiment. If people prefer the dropdown menu, I can give that a try. Note that for the file icon I simply used one of the standard stock icons for wxWidgets, the wxART_FILE_SAVE_AS icon (suggested size wxART_TOOLBAR). So, the icon should be the same as you see in GTK, KDE or whatever. I saw in the icons directory how to convert a PNG file, but before doing that I thought I'd give this a try. Dan |