Howdy, Stranger!

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

Supported by

[solved] How to increase widget size

edited December 2014 in OpenSesame

Hi, I was wondering how to scale up a check box widget that I create using an in-line python script. For my experiment I use a larger font (32pt) and check boxes appear too small next to their labels. Ideally I'd like to avoid building a custom widget just to get this. Any suggestions are welcome.

Comments

  • edited 3:06AM

    Hi Mitko,

    Isn't set widget_label "<span size=23>WIDGET</span>" what you're looking for?

    Alternatively, you might let your widget span over multiple cells. Unfortunately, I can't really tell how this works. I just saw on the documentation that it is somehow possible.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 3:06AM

    Hi Eduard,

    Thanks for your suggestion. I don't quite understand where I am supposed to enter the text you wrote. I'm creating the widget using python and your suggestion looks more like the standard OpenSesame script. Can I mix the two?

    Also, does your suggestion really scale the check box itself or just its label? The labels that I have are already using the 32pt font size automatically. It's just the square checkbox in front of the label that looks tiny. This is what I'd like to enlarge.

    As a workaround in the mean time, I have the following solution: I made a new python class that inherits from widgets.checkbox and reimplements the render method. Instead of drawing a box from an image (which is what the standard OpenSesame checkbox uses in widgets.checkbox ) I just draw the label preceded with the unicode characters for an empty/checked box

    Here is the code in case anyone is interested:

    class Checkbox( widgets.checkbox ):
        def __init__(self, form, text=u'checkbox', frame=False, group=None,
                checked=False, click_accepts=False, var=None):
            super(Checkbox, self).__init__(form, text, frame, group, checked,
                click_accepts, var)
    
        def render(self):
            mark = u'☑' if self.checked else u'☐'
            self.draw_text(mark + " " + self.text)
    

    Cheers,
    Mitko

  • edited 3:06AM

    Oh sorry. Apparently, I haven't read your questions. Indeed my suggestions works only for opensesame buit-in forms.

    If you only want the box to be bigger, you could have also just changed the self.box_size variable during initialization of your selfmade Checkbox class, but your solution seems to do the trick as well.

    Sorry again for the confusion. If everything is good now, I will mark this thread as solved, okay?

    Eduard

    Buy Me A Coffee

  • edited 3:06AM

    Hi Eduard,

    I tried changing the box_size as you suggested, but that only moved the text a little. The actual check box was still drawn the same size as before. Looking at the code in GitHub it seems that both available theme engines right now draw checkboxes with a fixed size (either 16 or taken from the standard checkbox image) and don't care about the checkbox.box_size field.

    Anyway, I'm happy with my current solution. Using the corresponding Unicode characters actually looks quite decent, so I'll stick with that. You can mark this thread as solved.

    Cheers,
    Mitko

  • edited 3:06AM

    Hi Mitko,

    Your solution is pretty elegant, but for the less Python-savvy I would like to point out yet another solution: You could replace the checkbox images in the resources/widgets/gray/ folder (which is a subfolder of the OpenSesame program folder on Windows).

    Cheers!
    Sebastiaan

  • Hey @mitko,

    I have the same problem with the too small check boxes. I tried the solution from @sebastiaan but it doesn't work so well (sorry :( ). First, the frame around the boxes stays the same size and somehow the larger checkboxes don't click so well. I would be interested in your workaround. Could you maybe go into more detail about how you did it?@sebastiaan

    Thank you!

  • Hi Mirko,

    Can you try to locate the folder that Sebastiaan pointed out? If you find it, you can replace the file in it with another file that contains a checkbox of your liking. Should be a simple image file. On my system (Ubuntu) the files are located here:

    Hope this helps.

    Eduard

    Buy Me A Coffee

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