Howdy, Stranger!

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

Supported by

Forms/Widgets: image as background for form

I would like to use an image (.png-file) as background for a form and would like to place the text_input widget on that image. So far, my workaround is to place the text_input under an image widget. Any idea on how to implement that (if it’s possible at all?).

Here’s the code for my form:

set timeout infinite
set spacing 5
set rows "7;1"
set only_render no
set margins "0;0;0;0"
set description type_occupation
set cols 1
#set background "image.png"  # => something like that would be nice
set _theme gray
widget 0 0 1 1 image path="[face]"   # this is my workaround
widget 0 1 1 1 text_input focus=yes return_accepts=yes var=response_get_occupation_input

PS: OpenSesame is really an amazing tool! As an experienced Presentation(R) and Matlab user, I wanted to switch to an open framework to implement my experiments. OpenSesame seems to do the trick! I managed to build several decent experiments within only a few hours! Keep up that amazing work!

Comments

  • Hi,

    You cannot easily add a background image to a form, but a little monkey-patching will do the trick. Say that you have a file called my_background.png in the file pool and that your form item is called my_form, then the script below will accomplish this. Essentially, it adds an image to form's Canvas and in addition makes sure that it stays on the bottom.

    Note: This requires OpenSesame 3.2, which is currently in prerelease! Doing the same thing 3.1 is possible, but more of a hassle.

    def lower_and_show(c, element, show_fnc):
    
        """This is a decorator for the orignal Canvas.show()"""
    
        def inner():
            c.lower_to_bottom(element)
            c.prepare()
            show_fnc()
    
        return inner
    
    
    c = items['my_form']._form.canvas
    c['my_background'] = Image(pool['my_background.png'])
    c.show = lower_and_show(c, 'my_background', c.show)
    

    Cheers,
    Sebastiaan

  • Hey Sebastiaan,
    I tried this code but it's not recognizing my form. Is there a way to select the form from a list so I'm sure that it is selecting the form? I get a message that says "name 'items' is not defined". What does that mean?

  • Hi Patricia,

    The items object did not exist in older versions of OpenSesame. Are you running an older version? If so, then I would update to the latest version (3.1) or better yet get a prerelease of 3.2.

    Cheers!
    Sebastiaan

  • I have the newer version. I haven't upgraded to 3.2 but it might be a good idea for me to do that now. Is 3.2 'stable-ish'? I haven't started my project yet so the timing is ideal.

  • As far as I know, the release of 3.2 will happen soon-ish, so it should be stable enough. And for a couple of small example experiments, it was stable for me. Probably best, if you try and and if it works, you are good.

    Eduard

    Buy Me A Coffee

  • I installed the new version on the weekend and posted some issues in another discussion. This discussion can be closed. Thanks for you help.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games