Ask Your Question

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

asked 2019-10-26 12:06:21 +0200

kxr gravatar image

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

edit retag flag offensive close merge delete



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

Ratslinger gravatar imageRatslinger ( 2019-10-26 22:18:02 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-10-26 22:19:43 +0200

Ratslinger gravatar image


You can do this with a simple dialog:

Sub Dialog1Show
    oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )
    wait 2000
End Sub

Dialog will close after 2 seconds (wait 2000).

edit flag offensive delete link more


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

mauricio gravatar imagemauricio ( 2019-10-27 17:26:02 +0200 )edit


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.

Ratslinger gravatar imageRatslinger ( 2019-10-27 17:54:58 +0200 )edit

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

mauricio gravatar imagemauricio ( 2019-10-27 19:00:01 +0200 )edit

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.

Ratslinger gravatar imageRatslinger ( 2019-10-27 19:15:09 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-10-26 12:06:21 +0200

Seen: 132 times

Last updated: Oct 26 '19