Android Question dont run EVENT first create lib

Tayfur

Well-Known Member
Licensed User
Longtime User
I am trying a new library.

I create alot of event . and they works.
So; I cant run Loaded event? I cant understand it
How is fix it.




B4X:
'Events declaration
#Event: ValuesChanged(Position As Int, Value As String)
#Event: maxValue(value as Int)
#Event: HomeClick
#Event: LeftClick
#Event: Loaded


Public Sub Initialize(CallbackModule As Object, cEventName As String)
    Callback = CallbackModule
    EventName = cEventName
    'Msgbox("intaliza","")
End Sub

Private Sub DesignerCreateView(Base As Panel, Lbl As Label, Props As Map)
'Public Sub DesignerCreateView(Base As Panel, Lbl As Label, Props As Map)
'****** we use the Base panel as the background panel
'*****************DESINGER MODU İÇİN GEREKLİ*************************************************
    Ana_Panel = Base
    Ana_Panel.AddView(pnl, 0, 0, Ana_Panel.Width, Ana_Panel.Height)
    pnl.BringToFront   
If SubExists(Callback, EventName & "_Loaded") Then
            CallSub(Callback, EventName & "_Loaded")
        End If
End Sub
 

Tayfur

Well-Known Member
Licensed User
Longtime User
Use CallSubDelayed instead of CallSub to allow the event to be raised from this method.

@Erel ; I complete my library. After I crete new project and Add my lib.
After open visula desinger , and I add customview.

After CostumType cilicked for add my lib. I cant find it?
How is add it. (it works when i creating lib)

my lib works with manuelly .
dim x mylib
x.intalize(...)

its works all events.

desing time my lib :
Untitled.png
 
Last edited:
Upvote 0
Top