Image "set_rect" error
Hi!
I'm sure this is super easy for all OS veterans. :)
I am trying to insert an image in a form, but I keep getting the following error message:
" widget.set_rect(self.get_rect(index))
AttributeError: 'Image' object has no attribute 'set_rect' "
This is my code:
def my_form_validator():
return var.gender != u'no'
button_ok = Button(text=u'Next')
label_gender= Label(u'Are you a boy or a girl?')
checkbox_male = Checkbox(text=u'I am a boy', group=u'gender', var=u'gender')
checkbox_female = Checkbox(text=u'I am a girl', group=u'gender', var=u'gender')
image_kids = Image(path=pool['kids.png']) #yes, the image is in the file pool
gender_form = Form(validator=my_form_validator, rows=[1,1,1,1], cols=[1,1])
gender_form.set_widget(label_gender, (0,0), colspan=2)
gender_form.set_widget(checkbox_male, (1,1))
gender_form.set_widget(checkbox_female, (1,2))
gender_form.set_widget(button_ok, (0,3), colspan=2)
gender_form.set_widget(image_kids, (0,1), colspan=2, rowspan=2)
gender_form._exec()
Comments
Also, just to mention that the code works if I delete the lines for the image.
Solved. THANK YOU!
Answer, as indicated by Sebastiaan, was here: https://osdoc.cogsci.nl/3.2/manual/forms/widgets/