Page 1 of 1

textbutton xmaximum ignored

Posted: Thu Dec 30, 2010 4:19 am
by jack_norton
I'm doing a custom preferences modifying the existing one, I wanted to add a "difficulty setting" option. I have found a bug (I think). If I set the buttons xmaximum, I can change the width of buttons:

Code: Select all

    style.pref_vbox.xfill = True

    style.pref_button.size_group = "pref"
    style.pref_button.xalign = 1.0
    style.pref_button.xmaximum= 120
but if I try the same inside the button codes, it doesn't work (same button size):

Code: Select all

            frame:
                style_group "pref"
                has vbox
                label _("Game Difficulty")
                hbox:
                    for i in range(3):
                        textbutton ("{size=18}"+SDiff[i]+"{/size}") xmaximum 100 action SetDifficulty(i) 
xmaximum 100 is completely ignored. I don't understand then how I can change the xmaximum in preferences ? :(

Re: textbutton xmaximum ignored

Posted: Thu Dec 30, 2010 10:29 am
by PyTom
xmaximum only takes affect if the button wants to be bigger than that. You might also want to set an xminimum on the button.