That doesn't matter, Xin, I passed it an empty table in my test, and it worked fine. LDBIcon will populate with default values if none exist.
Hellmonkey, please post the contents of your "FramesVisi_OnLoad" function and mark which line is #589. That's where the error is originating, but without seeing your code, I couldn't really say why the error is occuring.
Yeah, it's definitely the way you're initializing everything so early. I loaded your Lua, moved the button, reloaded UI, got a random position. Changed the Lua to delay initializing and registering stuff until later in the loading process, moved the button, reloaded, button stayed where I'd put it.
The third parameter to LDBIcon:Register must be a table to contain position and other settings for the minimap icon. Do not put your whole saved variables table in there. If "BEWdb" contains anything other than settings from LDBIcon, you're doing it wrong, and you should add a "minimapIcon" table within the "BEWdb" table, and give LDBIcon that subtable:
You may also want to initialize your saved variables properly, by creating a frame, registering for the ADDON_LOADED event, and when the addon loaded is yours, initialize your saved variables and unregister the event.
No, that is wrong. For some reason the OnTooltipShow function was designed without the self parameter. It caused me a great deal of headaches in my own plugins, trying to figure out why I was getting nil value errors for the tooltip parameter. OnTooltipShow = function(tooltip) is correct.
Unless you have another line of code setting the value of the variable [FONT="Courier New"]BoksEasyWarr[/FONT], that is your problem. The second argument to LDBIcon:Register must be the data object itself, not just the data object's title. Try this (take note of the bolded sections):
Once you have your LDB data object set up (as it sounds you do) all you need to to get LDBIcon to work is this:
[FONT="Courier New"]LibStub("LibDBIcon-1.0"):Register("My Data Object", myDataObject, settings)[/FONT]
...where [FONT="Courier New"]myDataObject[/FONT] is a reference to your LDB data object, and [FONT="Courier New"]settings[/FONT] is a table (probably in your addon's settings, so self.db.profile.ldbiconsettings or something) where LDBIcon will save information about the icon (show/hide and position).