I'm trying to code a custom preferences menu. It's supposed to look like this mockup:

I figure the easiest way to get that layout would be to use a grid with 1 column and 4 rows, then split each row up with hboxes and frames. This is the code I've cobbled together to try to achieve that:
Code: Select all
grid 1 4:
style_group "prefs"
xfill True
hbox:
frame:
style_group "pref"
has vbox
label "display"
hbox:
textbutton "window" action Preference("display", "window")
textbutton "fullscreen" action Preference("display", "fullscreen")
frame:
style_group "pref"
has vbox
label "transitions"
hbox:
textbutton "show all" action Preference("transitions", "all")
textbutton "show none" action Preference("transitions", "none")
hbox:
frame:
style_group "pref"
has vbox
label "skip"
hbox:
textbutton "all messages" action Preference("skip", "seen")
textbutton "seen messages" action Preference("skip", "all")
frame:
style_group "pref"
has vbox
label "font size"
hbox:
textbutton "14" action StylePreference("size", "14")
textbutton "18" action StylePreference("size", "18")
textbutton "22" action StylePreference("size", "22")
frame:
style_group "pref"
has vbox
label "after choices"
hbox:
textbutton "stop skipping" action Preference("after choices", "stop")
textbutton "keep skipping" action Preference("after choices", "skip")
hbox:
frame:
style_group "pref"
has vbox
label "auto-forward speed"
bar value Preference("auto-forward time")
frame:
style_group "pref"
has vbox
label "music volume"
bar value Preference("music volume")
hbox:
frame:
style_group "pref"
has vbox
label "text speed"
bar value Preference("text speed")
frame:
style_group "pref"
has vbox
label "sound volume"
bar value Preference("sound volume")

Clearly I've done something wrong, but I don't understand what. I thought the hboxes in each row would spread the frames evenly across the row, but the first frame in each hbox is taking up all of the row. What should I do to fix that? (I'm not worried about the navigation menu by the way, I've already fixed that since taking that screenshot.)
I could just cheat and use an imagemap of course - but probably some stuff will be added to this menu later, and I would like to learn how to do it properly.
Thanks in advance for any advice!


