lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


How about this:

Personally, I would ditch the word Create, but that is a question of style.
I like constructors whose names are the names of the type itself.

     CreateGUI
     {
          name = "Canvas",
          horizontal = "left",
          vertical = "top",
          position = "0 0",
          visible = 1,
          bitmap = "./bitmaps/bitmap.jpg",
          size = "640 480",
            components = {
                CreateComponent
                {
                     type = "ClockComponent",
                     name = "Clock",
                     horizontal = "left",
                     vertical = "top",
                     position = "0 0",
                     visible = 1,
                     size = "100 100"
                  },
                  CreateComponent
                  {
                  -- etc.
                  }
          }
     }