XUI library v1.4 adds support for asynchronous msgbox dialogs.
The API is simple:
The dialog is not a modal dialog. The code will not stop.
MsgboxAsync and Msgbox2Async return an object that can be used as the sender filter parameter in a Wait For call.
To wait for the dialog to being dismissed:
Msgbox2Async provides more options:
You can pass Null instead of the image.
You can pass "" (empty string) to remove buttons.
Note that the icon parameter is not used in B4i.
The API is simple:
B4X:
xui.MsgboxAsync("Hello", "World")
The dialog is not a modal dialog. The code will not stop.
MsgboxAsync and Msgbox2Async return an object that can be used as the sender filter parameter in a Wait For call.
To wait for the dialog to being dismissed:
B4X:
Wait For (xui.MsgboxAsync("Hello", "World")) Msgbox_Result (Result As Int)
Msgbox2Async provides more options:
B4X:
Dim icon As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "warning.png", 60dip, 60dip, True)
Dim sf As Object = xui.Msgbox2Async("Delete file?", "Title", "Yes", "Cancel", "No", icon)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
Log("Deleted!!!")
End If
You can pass Null instead of the image.
You can pass "" (empty string) to remove buttons.
Note that the icon parameter is not used in B4i.