[Chicago] Presentation on Boo or Declaratice programming for Windows Forms
Feihong Hsu
hsu.feihong at yahoo.com
Tue Apr 3 17:01:14 CEST 2007
I was thinking about preparing a presentation on Boo in the context
of Microsoft's XNA game development framework, but I haven't had time
to look into XNA yet. However, if people are interested, I could
give a short introduction to Boo (Boo is a statically compiled
language for .NET and Mono that has Python-like syntax).
In the past month I've had to do a lot of GUI development, and I
created my own library for Windows Forms that uses a declarative
syntax similar to the Breve template engine. Basically, the syntax
for a form (frame) could be written as a single expression:
Form[
# Text box that takes up all available space in the middle:
TextBox(Dock=DockStyle.Fill, Name='content'),
# Button panel at the top:
HBox(Dock=DockStyle.Top)[
Button(Text='Open'),
Button(Text='Save'),
],
# List box at the bottom:
ListBox(Dock=DockStyle.Bottom, Name='sections')[
'section 1',
'section 2',
'section 3',
],
]
The above is pure Python syntax that you could just paste into the
interactive interpreter. I don't know how readable that is to people
who don't do GUI programming, but it's a heck of a lot better than
the normal API for Windows Forms.
Personally, I don't want to go into Windows Forms too much unless
people wanted that. I would mostly just talk about how I implemented
the library so that people could do the same thing for other GUI
libraries like PyGTK and wxPython.
- Feihong
____________________________________________________________________________________
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail
More information about the Chicago
mailing list