Howdy, Stranger!

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

Supported by

[solved] widget draw_frame

edited June 2013 in OpenSesame

Hello,

I understand that using draw_frame function when wanting to draw a frame to a widget is done by python code, is that true? If yes, my question is: how can I draw a frame on a widget using only opensesame script?
Besides the option of - frame="yes" - because this shows a grey frame which doesn't look so good, and does not match the word on the widget.
I need the frame to be only a rectangular shape surrounding the word on the widget.

this is the custom form I made:

set margins "150;100;50;100"
set rows "1;1;1;1;1;1"
set spacing "25"
set cols "1;1;1;1;1;1;1;1;1"
set description "A generic form plug-in"
widget 3 0 3 1 label center="yes" text="What shape did you see?"
widget 1 2 1 1 button text="[op1]" frame="true" var="response"
widget 3 2 1 1 button text="[op2]" frame="true" var="response"
widget 5 2 1 1 button text="[op3]" frame="true" var="response"
widget 7 2 1 1 button text="[op4]" frame="true" var="response"

Thank you,
Nagham

Comments

  • edited 1:53AM

    Hi Nagham,

    Forms support theming. Currently, there are only two themes available: 'plain' and 'gray'. The default is 'gray', and this theme indeed draws large gray frames. The 'plain' theme only draws an outline, which may be what you want. You can select the theme like so:

    set theme plain
    

    Btw, in your example you have frame="true", which should be frame="yes", as described here:

    Cheers!
    Sebastiaan

  • edited May 2013

    d

  • edited 1:53AM

    Hi,

    Thank you, the frame looks good now. There's a problem with the position of the word in it though, when it is a short word it is placed in the center, but when it is a long word it's lower. I tried to set center="yes" but it didn't help.
    Any thought on why this happens and how can I fix it?

    Thanks again,
    Nagham

  • edited 1:53AM

    Hi Nagham,

    If you have specified center="yes" the text should appear in the middle of the frame, regardless of how much text there is (although it will look ugly if the text doesn't fit). Could you post a screenshot + the script, so we can see what exactly goes wrong?

    Cheers,
    Sebastiaan

  • edited 1:53AM

    Hi,
    Is there an email address I can send it to?

    Thanks,
    Nagham

  • edited 1:53AM

    Hi Nagham,

    To upload your experiment you could do the following:

    • Open the "General properties" tab in OpenSesame, click "Script editor" and copy the whole script,
    • go to pastbin.com or gist.github.com, upload your script there (simply paste and submit)
    • and provide us with the resulting link in your forum post.

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 1:53AM

    It is fixed now thank you, I just had to enlarge the columns width apparantly

Sign In or Register to comment.