All,
I'm having some trouble with progress bars in Python.
When I initialize a progress bar in a separate window for a plugin in TinyScheme as follows it works like a dream.
> (gimp-progress-init "Processing" -1)
(#t)
When I try to do the same in Python however I get the following error.
>>> pdb.gimp_progress_init ("Processing...",-1)
Traceback (most recent call last):
File "", line 1, in
TypeError: wrong parameter type
>>>
Does anyone know what's going on here?
Maybe this will help
def pogress( disp, lay ): ... for i in xrange(0,101): ... ... pdb.gimp_layer_set_opacity(lay, i) ... ... pdb.gimp_progress_update(i*0.01) ... pdb.gimp_progress_end() ...takes a display and a layer to change the opacity of and shows the progress. yeah, real efficcient - i know ;) if you want it to be in the display, you should use the progress-init. You can even deside wether you want the progress to be shown or not:def pogress(lay, disp = None): ... if disp != None : ... ... pdb.gimp_progress_init("processing", disp) ... for i in xrange(0,101): ... ... pdb.gimp_layer_set_opacity(lay, i) ... ... pdb.gimp_progress_update(i*0.01) ... pdb.gimp_progress_end() ...calling pogress(layer) will change the opacity, but not show it in the display, rather a seperate window, calling pogress(layer,display) will show the progress bar in the display "display" Tested with: Gimp 2.4.6 Python Console Python 2.5.2 (r252:60911, Nov 23 2008, 17:36:17) [GCC 4.1.2 (Gentoo 4.1.2)] P.S. Yes i know it is spelled "progress" let's just say it was to avoid name confusion ;)Doesn't that function only
Values like -1 do usually
extra parameters in Python vs Scheme scripts calling Gimp