[scribus] Giving a list as argument [Solved]

Stephane Santon m.scribus at santonum.eu
Sun Feb 9 09:51:24 UTC 2014


Hello,

I finally found the solution ! Python beginner's problem...

The fact is that, as the function is a class method, I HAVE to give 
'self' as first argument which is the instance reference, and then the 
other parameters.
And must not write this parameter at the function call :

      def setHeightsToFirst( self, aObjs, aStartIndex, aCount):
          messageBox("Arrange", "Heights Start", ICON_INFORMATION)

      def arrangeImages( self):
          self.setHeightsToFirst( laoImages, 0, 3)

Have a good day !

Le 08/02/2014 16:38, Stephane Santon a écrit :
> class TkImageAlignmentWizard(Frame):
>      """ GUI interface """
> [...]
>
>      def setHeightsToFirst( aObjs, aStartIndex, aCount):
>          messageBox("Arrange", "Heights Start", ICON_INFORMATION)
>
>      def arrangeImages(self):
>          laoImages = self.get_images_on_page()
>          lsMsg = "Heights Run " + str( len( laoImages) )
>          messageBox("Arrange", lsMsg, ICON_INFORMATION)
>
>          self.setHeightsToFirst( laoImages, 0, 3)
>          docChanged(1)
>          setRedraw(True)
>          messageBox("Arrange", "Done\n", ICON_INFORMATION)
>
>
> But my script is stopping with no error message on
>          self.setHeightsToFirst( laoImages, 0, 3)
>
> The messageBox implementationn in this method is not executed.
> So I think there is a problem with the first argument Value which is a
> List.


-- 
Stephane Santon
Saintes, La Rochelle, Bordeaux, Cognac - France



More information about the scribus mailing list