For one of my plugins I'm rewriting the GUI with Glade (new for me) to get a better user interface divided into logical groups. The problem is that I don't know how to register it for Gimp. The testsource beneath works (XML file is not enclosed) but what have I to add/change for GIMP or has anyone a (small) example for me. I've looked on several forums (Glade, Pyhon, and others) but found nothing usefull.
Elmar
=======================
#!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import sys
import gtk
class Tutorial:
def on_window1_destroy(self, widget, data=None):
gtk.main_quit()
def on_checkbutton1_toggled(self, widget, data=None):
print "button was toggled"
if widget.get_active():
print "True"
else:
print "False"
def __init__(self):
builder = gtk.Builder()
builder.add_from_file("CheckButton.xml")
self.window = builder.get_object("window1")
builder.connect_signals(self)
## def MyPluginName(arg1, arg2,....)
## do the job
if __name__ == "__main__":
editor = Tutorial()
editor.window.show()
gtk.main()
=================================
Using Glade in plugins
On this site, see the Inspect plugin or the Make Shortcut plugin for examples of using Glade in Python Gimp plugins.
Using Glade in plugins
I've been looking at the makeshortcut plugin already. I didn't know that the inspect pluging also uses Glade I will study that one also.
Thanks
Solved registerproblem Glade, Python and Gimp
This is for programmers only not for end users.
At least I solved my problem with help of a few examples of bootchk (inspect: http://registry.gimp.org/node/24238 and make shortcut: http://registry.gimp.org/node/24300), thanks bootchk.
Uses bootchk a dictonairy to interface I used the "old style" for one reason: changing the original code as less as possible. For the result see the code of indexprint at http://registry.gimp.org/node/24503.