instead of calling gimp-displays-flush twice a second, call it after each
2008-08-13 Sven Neumann <sven@gimp.org> * plug-ins/pygimp/plug-ins/python-console.py: instead of calling gimp-displays-flush twice a second, call it after each command that is committed. This is similar to what the Script-Fu console does. * plug-ins/script-fu/script-fu-console.c: formatting. svn path=/trunk/; revision=26543
This commit is contained in:

committed by
Sven Neumann

parent
d1a37ae49b
commit
d87877c257
@ -1,3 +1,12 @@
|
||||
2008-08-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/pygimp/plug-ins/python-console.py: instead of calling
|
||||
gimp-displays-flush twice a second, call it after each command
|
||||
that is committed. This is similar to what the Script-Fu console
|
||||
does.
|
||||
|
||||
* plug-ins/script-fu/script-fu-console.c: formatting.
|
||||
|
||||
2008-08-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/pygimp/pygimp-colors.c: fix compiler warnings.
|
||||
|
@ -41,6 +41,17 @@ def do_console():
|
||||
if s[0] != '_':
|
||||
namespace[s] = getattr(gimpenums, s)
|
||||
|
||||
class GimpConsole(pyconsole.Console):
|
||||
def __init__(self, quit_func=None):
|
||||
banner = ('GIMP %s Python Console\nPython %s\n' %
|
||||
(gimp.pdb.gimp_version(), sys.version))
|
||||
pyconsole.Console.__init__(self,
|
||||
locals=namespace, banner=banner,
|
||||
quit_func=quit_func)
|
||||
def _commit(self):
|
||||
pyconsole.Console._commit(self)
|
||||
gimp.displays_flush()
|
||||
|
||||
class Console(gimpui.Dialog):
|
||||
def __init__(self):
|
||||
gimpui.Dialog.__init__(self, title=_("Python Console"),
|
||||
@ -55,11 +66,7 @@ def do_console():
|
||||
RESPONSE_CLEAR,
|
||||
RESPONSE_SAVE))
|
||||
|
||||
banner = ('GIMP %s Python Console\nPython %s\n' %
|
||||
(gimp.pdb.gimp_version(), sys.version))
|
||||
|
||||
self.cons = pyconsole.Console(locals=namespace, banner=banner,
|
||||
quit_func=lambda: gtk.main_quit())
|
||||
self.cons = GimpConsole(quit_func=lambda: gtk.main_quit())
|
||||
|
||||
self.connect('response', self.response)
|
||||
|
||||
@ -201,17 +208,9 @@ def do_console():
|
||||
|
||||
def run(self):
|
||||
self.show_all()
|
||||
|
||||
# flush the displays every half second
|
||||
def timeout():
|
||||
gimp.displays_flush()
|
||||
return True
|
||||
|
||||
gobject.timeout_add(500, timeout)
|
||||
gtk.main()
|
||||
|
||||
console = Console()
|
||||
console.run()
|
||||
Console().run()
|
||||
|
||||
register(
|
||||
PROC_NAME,
|
||||
|
@ -609,6 +609,7 @@ script_fu_cc_key_function (GtkWidget *widget,
|
||||
output->len,
|
||||
console);
|
||||
}
|
||||
|
||||
g_string_free (output, TRUE);
|
||||
|
||||
gimp_displays_flush ();
|
||||
|
Reference in New Issue
Block a user