Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugin for converting images to g-code for laser engraving
#7
(02-07-2019, 11:50 PM)Ofnuts Wrote:
(02-07-2019, 09:17 PM)DougCoffland Wrote: I used gtk because I couldn't figure out how to get the standard file chooser to warn the user that the file that was selected already exists and to ask the user if they want to replace it. If there is a way to configure the standard file chooser to do this, it would certainly make things simpler.

Do you have any suggestions on how to do this?

As far as I can see, the file chooser that Gimp use when you do File>Export already cover this. So if you change your plugin to register as a proper export plugin, when you will be called the file overwrite check will have been  already performed by Gimp.

Yes, File>Export seems to work correctly. But my plug-in does not work the way I want it to when I use the standard file interface. If I can make it work like File>Export, that would be great.

I have attached a version of my script that does not use 'gtk'. It's called "no-gtk.py" and runs under Gim  2.10 on Windows 10.

The dialog comes up with the Output file field empty. Click the button to select a file. The select a file that already exists that you don't mind overwriting. Then, click OK to run the program. The selected file gets overwritten and you don't get warned.

I must be doing something wrong. Do you have any suggestions? Thanks...
Reply


Messages In This Thread
RE: Plugin for converting images to g-code for laser engraving - by DougCoffland - 02-08-2019, 06:32 PM

Forum Jump: