From 507ab64f4a6562209d82699abef588fb0ae89916 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 6 Apr 2008 11:26:25 +0000 Subject: [PATCH] * Expose TomTom:InitializeDropdown(uid) that can be used to init the dropdown * Fix a bug where checkboxes could be put in the wrong place on dropdown menus --- TomTom.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index 548507c..5273f69 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -457,11 +457,19 @@ local function init_dropdown(level) for k,v in pairs(entry) do new[k] = v end new.checked = new.checked() entry = new + else + entry.checked = nil end + UIDropDownMenu_AddButton(entry, level) end end +function TomTom:InitializeDropdown(uid) + self.dropdown.uid = uid + UIDropDownMenu_Initialize(self.dropdown, init_dropdown) +end + function TomTom:UIDIsSaved(uid) local data = waypoints[uid] if data then @@ -504,8 +512,7 @@ end -- Define callback functions -------------------------------------------------------------------]]-- local function _both_onclick(event, uid, self, button) - TomTom.dropdown.uid = uid - UIDropDownMenu_Initialize(TomTom.dropdown, init_dropdown) + TomTom:InitializeDropdown(uid) ToggleDropDownMenu(1, nil, TomTom.dropdown, "cursor", 0, 0) end -- 1.7.9.5