LibDBIcon has dependancies on LibStub and LibCallBackHandler. Those should both be included in your addon (lib folder) and .toc (or other .XML include file eg. embeds.xml) in case the user doesn't have another addon that does include them (libs aren't automatically included or loaded).
Frame names are also added to the global table and should also be unique "CodgerAddonFrame" instead of "MyAddonFrame". If it has a name (and is unique) you can use it in your show/hide code
Lua Code:
OnClick = function(self, button)
if button == "LeftButton" then
CodgerAddonFrame:SetShown(not CodgerAddonFrame:IsShown()) -- toggle show/hide
elseif button == "RightButton" then
print("Right click not configured")
end
end,
Edit: Missed the "MyAddon" in:
Code:
local icon = LibDBIcon:Register("MyAddon", {
It should also be unique (like the name of your addon folder).