[scribus] single form to enter multiple valuedialogs

Gregory Pittman gregp_ky at yahoo.com
Sat May 7 00:00:02 UTC 2011


On 05/06/2011 06:13 PM, Fred Zimmerman wrote:
> Hi,
>
> I have a script that asks for a bunch of different inputs from the user.
> rather than having value dialogs pop up one after another, I would like to
> have one GUI form pop up, enter all the values, and hit "submit" once.  How
> can I accomplish this?

Hi FredZ,

If you look at this script:

http://wiki.scribus.net/canvas/A_Standard_Form_with_Barcodes_and_Custom_Entries

you will see that I used valueDialogs for entering 2 values at once:

  age_DOB = scribus.valueDialog('Age + DOB','Age and DOB (MM/DD/YYYY) 
are \n(Separate with white space only)')
  ageDOB = age_DOB.split()
  age = ageDOB[0]
  DOB = ageDOB[1]

The method here is to put values in the dialog separated by white space 
(it doesn't matter how much). The split function then put the values 
without white space into a list (ageDOB), then for clarity I rename the 
variable names.

AFAIK, there is no reason you couldn't do more values than 2, creating a 
longer list, then using them as needed. Remember these will all be 
strings, so convert if something will be used as a numeric value.

I also think (not absolutely sure) that you can assign tuples:

value1, value2, value3 = scribus.valueDialog('3 values','Enter 3 values 
separated by commas')

Greg



More information about the scribus mailing list