Sub AddButton(Module As Object, parentID As String, btnID As String, btnLabel As String, btnRaised As Boolean, btnIcon As String, iconColor As String, btnTooltip As String, btnBadge As String, badgeColor As String) As VBtn
parentID = parentID.tolowercase
btnID = btnID.tolowercase
'
'get the parent
Dim Ret As Long
Dim AllViews As Map
'load button icon and clear the placeholder
Ret = BANano.LoadLayoutArray("#placeholder", "buttonicon", True)
' ret returns a unique number you can use to get all views
AllViews = BANano.GetAllViewsFromLayoutArray(Module, "buttonicon", Ret)
'get the tooltip title
Dim buttontooltiptitle As VDiv = AllViews.Get("buttontooltiptitle")
buttontooltiptitle.SetCaption(btnTooltip)
'get the badge
Dim buttonbadge As VBadge = AllViews.Get("buttonbadge")
buttonbadge.SetContent(btnBadge)
buttonbadge.SetColor(badgeColor)
'get the button
Dim button As VBtn = AllViews.get("button")
If btnRaised = False Then button.SetText(True)
button.SetOnClickE(btnID)
button.SetOnClick
'get the button label
Dim buttontitle As VDiv = AllViews.Get("buttontitle")
buttontitle.SetCaption(btnLabel)
'get the icon
Dim buttonicon As VIcon = AllViews.get("buttonicon")
buttonicon.SetCaption(btnIcon)
buttonicon.SetColor(iconColor)
'
Dim strx As String = MyApp.BANanoGetHTML("#placeholder")
Log(strx)
MyApp.BANanoEmpty("#placeholder")
'MyApp.BANanoGetHTML1("#placeholder", parentID)
'return the button
Return button
End Sub