Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Image "set_rect" error

edited May 23 in OpenSesame


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)



Sign In or Register to comment.