How Gazpacho Works

Important Edit: I just realised Gazpacho is pretty well designed!

Ok, well Gazpacho is complicated. Johan said it best when he said "a user interface designer is a complicated application", well, this is an insane one. Now we have goals with Gazpacho, and that is to simplify it. So first we need to describe how it works.

I have done this here, in the hope that no one will ever ever ever have to do it after me.

Project (gazpacho.project.Project) is Loaded:

(a "Project" is basically a glade file.)

  • It uses a g.loader.gazpacholoader.GazpachoObjectBuilder (subclass of g.l.loader.ObjectBuilder)
    • This parses the XML and hands it off to the gazpacho.loader.custom.adapter_registry
    • Each widget has an "adapter" (g.l.custom.Adapter subclass) that is the controller between the UI and the widget itself, eg setting attributes, adding children
  • Now the project tries to create a "gadget" from the widget using g.project.load_gadget_from_widget
    • This checks in the g.widgetregistry.widget_registry (another registry, which is an instance of g.widgetregistry.WidgetRegistry) for another adapter
    • This adapter is now a g.widgetadapter.WidgetAdapter which creates the actual widget that will be displayed in the UI
    • This lookup allows the gadget to be constructed, which is a g.gadget.Gadget, and basically a wrapper around a normal widget with added stuff for Gazpacho

So the Gadget is what you are looking at!

How do you make a magic property editor appear for a widget property?

prop_registry.override_simple('GtkButton::label', LabelAdaptor)

How do you do stuff to widget property views:

prop_registry.override_simple('GtkButton::use-stock', editable=False)

Problems with Gazpacho.

  • Terrible naming of modules and variables so that nothing makes any sense.