Anders Hammarquist - Metaclasses for fun and profit: Making a declarative GUI implementation

preview_player
Показать описание
Anders Hammarquist - Metaclasses for fun and profit: Making a declarative GUI implementation
[EuroPython 2016]
[20 July 2016]
[Bilbao, Euskadi, Spain]

When standard Python syntax doesn't cut it, apply metaclasses to make
it do what you want. Here I present our metaclass-based implementation
of a declarative GUI layout syntax to inspire ideas for what to do
when your goals don't fit the Python syntax.

-----

When overhauling the user interface of Autolabel's labeling printers,
we wanted a clean way to describe the layout of the settings widgets.
The structure we came up with was a declarative class layout that
leverages Python's metaclass concept to build the underlying GTK
widget structure.

I will present the implementation to hopefully inspire you to apply
metaclass techniques to problems that standard Python syntax can't
quite solve. If that fails, you will at least have a way to
declaratively construct GTK GUIs.

A short, non-exaustive, summary of concepts I will mention includes
metaclasses (obviously), class hierarchies, method resolution
order, super(), and anecdotes of dealing with GTK.

You may find some similarities with my talk on Python as a domain
specific language at Europython 2006

Рекомендации по теме
welcome to shbcf.ru