I'm developing a GUI library (ultimately to build my notebook with). I would like to have widgets as almost class type objects. I was wondering whether the following code would save a bunch of references to a single function, or lots of functions in the save file (bloating the save).
Code: Select all
g_prototypes = {
drawPanel = function(self, widget)
-- Do Draw Stuff
end,
drawLabel = function(self, widget)
-- Do Draw Stuff
end
}
function createPanel(...)
widget.onDraw = g_prototypes.drawPanel;
...
end
-- Create Lots of Widgets