3 ms·
I did something similar to that once -- a program that compiled GUI descriptions into a runable Python class, which could then be subclassed to provide functio
by cabalamat 16y ago
I did something similar to that once -- a program that compiled GUI descriptions into a runable Python class, which could then be subclassed to provide functionality. The syntax looked like this:
window @MyBigWindow "My Big Window" {
menuBar {
menu "File" {
menuItem @New "New"
menuItem @Open "Open..."
menuItem @Save "Save"
menuItem @Exit "Exit"
}
menu "Edit" {
menuItem @Copy "Copy"
menuItem @Cut "Cut"
menuItem @Paste "Paste"
}
}
rowLayout {
button "Button 1"
button "Button 2"
button "Button 3"
}
}
Laying out GUI components was done with the rowLayout, colLayout and table containers. The subclass would contain code to be executed for @New, @Open, @Save, etc.
- Vivtek 16y agoThere's some similar stuff for wx in Perl and Python, too - I've just been taking the time to (try to) be systematic about making things fast and easy to specify. I really, really get tired of coding all that stuff by hand every damn time - it's one of the major things that made me get out of GUI work in the first place, back in the Stone Age. I've got big plans, and since it's not expected to pay any bills for a while, I can afford to think things through sufficiently. I just hope I won't drop it entirely. It's been fun so far, though.
- cabalamat 16y ago> I really, really get tired of coding all that stuff by hand every damn time - it's one of the major things that made me get out of GUI work in the first place Absolutely. Having sensible and configurable defaults for everything is the way to go.