--OSListItem-- __index = OSMenuItem -- parent class type = "OSListItem" SelectedBackgroundColour = colours.lightBlue SelectedTextColour = colours.white BackgroundColour = colours.white TextColour = colours.black new = function(self, _title, _action) local new = {} -- the new instance setmetatable( new, {__index = OSListItem} ) -- copy an instance of OSMenuItem new.height = 1 new.title = _title new.action = _action return new end Draw = function(self) local bgColour = self.BackgroundColour local textColour = self.TextColour --if the item is selected give it the background and text color if self.isSelected then bgColour = OSListItem.SelectedBackgroundColour textColour = OSListItem.SelectedTextColour self.isSelected = false end local title = self.title if string.len(self.title) > self.width-1 then --check if the menu self is a splitter (dont have the padding) title = string.sub(self.title, 1, self.width-4) .. "..." end OSDrawing.DrawBlankArea(self.x, self.y, self.width, self.height, bgColour) OSDrawing.DrawCharacters (self.x, self.y, " ".. title, textColour,bgColour) end