Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get position of main GIMP window?
#2
When you do a gimp_file_load() there is no window created (because if very many case you apply a processing, save, and exit.... If you want a window you have to create a Display:
Code:
window=gimp.Display(image)

Remember also that the python plugin runs in its own separate process, so you can't use calls that only deal with the window of your process. 

However, the general philosophy of the scripts/plugins is that they are meant for processing and not to tweak the UI. So you will  be doing things that may conflict with Gimp's UI (for instance, you can't even tell if you are in single-window mode, in which case your TOP LEVEL window is going to be the same for all).

Another bit of Gimp's UI philosophy is that you try to make a best guess for the position the first time your create the dialog, but more importantly save the position for further uses. This covers the case of people with two monitors, one for the image and one for the controls (your dialog will open on the wrong monitor only once).
Reply


Messages In This Thread
RE: How to get position of main GIMP window? - by Ofnuts - 11-09-2017, 09:55 AM

Forum Jump: