BASIC: how to raise temporary popup message ("toast")

BASIC: how to raise a temporary popup message (“toast”) - not a normal MsgBox which needs to be clicked away?

Hello,

Please when referring to something in another product, please mention the product. Did not know “toast” (android messaging) until searched for it.

Hello,

You can do this with a simple dialog:

Sub Dialog1Show
    DialogLibraries.LoadLibrary("Standard")
    oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )
	oDialog1.setVisible(true)
	wait 2000
End Sub

Dialog will close after 2 seconds (wait 2000).

I think, setVisible should set visible dialog, not hide after… why automatic hide it?

@mauricio,

This is what temporary popup message ("toast") actually does. It is a short term message which requires no user intervention to close. See How TO - Snackbar / Toast and example you can try there.

Yes, I understand the requirement. But, for me, setVisible should show (or hidden) object. Only that.

Guess I am not understanding your comments. To stop user intervention, instead of "execute’ of Dialog, setVisible displays the dialog and when the timer expires the dialog is destroyed. This is also a process to use in a non-modal dialog (see How to make non-modal dialog?) although for this I prefer to create the entire dialog in a macro and specify it as non modal.