John Spray
2010-06-22 13:54:45 UTC
---------- Forwarded message ----------
From: Matej Urbas <matej.urbas at gmail.com>
Date: Tue, Jun 22, 2010 at 1:06 AM
Subject: Referencer Plugin: Configuration Dialog
To: jcspray at icculus.org
Hi!
Could I please ask you for advice on how to display a configuration
dialog for a python plugin in Referencer?
This is my current code (excerpt from file 'ReferencerNotes.py'), which
works as a standalone application but not if invoked from Referencer:
def referencer_config():
dlg = ConfigDialog()
dlg.mainWindow.run()
class ConfigDialog:
def __init__(self):
# Initialise the UI builder
self.builder = gtk.Builder()
self.builder.add_from_file(CONFIG_DIALOG_GLADE_FILE)
self.builder.connect_signals(self)
# Fetch all relevant widgets in the dialog
self.mainWindow=self.builder.get_object("dlgConfig")
self.fileChooser=self.builder.get_object("fcbNotesPath")
# Initialise the currently configured directory...
self.fileChooser.set_filename(NOTES_DIRECTORY)
def config_ok_click(self, widget, data=None):
set_notes_directory(self.fileChooser.get_filename())
Thank you very much for your help!
Cheers,
---
Matej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/referencer/attachments/20100622/2bd67a82/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://icculus.org/pipermail/referencer/attachments/20100622/2bd67a82/attachment.pgp>
From: Matej Urbas <matej.urbas at gmail.com>
Date: Tue, Jun 22, 2010 at 1:06 AM
Subject: Referencer Plugin: Configuration Dialog
To: jcspray at icculus.org
Hi!
Could I please ask you for advice on how to display a configuration
dialog for a python plugin in Referencer?
This is my current code (excerpt from file 'ReferencerNotes.py'), which
works as a standalone application but not if invoked from Referencer:
def referencer_config():
dlg = ConfigDialog()
dlg.mainWindow.run()
class ConfigDialog:
def __init__(self):
# Initialise the UI builder
self.builder = gtk.Builder()
self.builder.add_from_file(CONFIG_DIALOG_GLADE_FILE)
self.builder.connect_signals(self)
# Fetch all relevant widgets in the dialog
self.mainWindow=self.builder.get_object("dlgConfig")
self.fileChooser=self.builder.get_object("fcbNotesPath")
# Initialise the currently configured directory...
self.fileChooser.set_filename(NOTES_DIRECTORY)
def config_ok_click(self, widget, data=None):
set_notes_directory(self.fileChooser.get_filename())
Thank you very much for your help!
Cheers,
---
Matej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/referencer/attachments/20100622/2bd67a82/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://icculus.org/pipermail/referencer/attachments/20100622/2bd67a82/attachment.pgp>