ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Toast functions
  • Properties specific to Toast variables
  • WLanguage functions that use Toast variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The Toast type is used to define all the advanced characteristics of a toast notification. You can define and change the characteristics of this toast using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
MyToast is Toast
MyToast.Title = "Did you know?"
MyToast.Text = "AAFs are really cool."
MyToast.Button[1].Caption = "Learn more..."
MyToast.Button[1].ActionClick = FuncHelp
MyToast.ActionClose = clickClose
ToastDisplay(MyToast)
INTERNAL PROCEDURE FuncHelp
	Open ("WIN_Help")
END
INTERNAL PROCEDURE clickClose(nButton)
	Trace("Click to close. Button: " + nButton)
END
// Displays a toast without the product name
MyToast is Toast
MyToast.DisplayDuration = toastLong
MyToast.VerticalAlignment = vaBottom 
MyToast.HorizontalAlignment = haCenter
ToastDisplayIW(IW_TOAST_DELETE, MyToast, PRODUCT.NAME)
//------------------------------------
// Global declarations of the internal window
PROCEDURE IW_TOAST_DELETE(ProductName)
STC_TEXT = StringBuild("The product %1 has been deleted", ProductName)
Properties

Properties specific to Toast variables

The following properties can be used to handle a toast notification:
Property nameTypeEffect
ActionCloseWLanguage procedureAction to be performed when the toast is closed.
This property corresponds to the name of the procedure to be executed when the button in the toast is clicked.
This procedure takes the number of the clicked button as an optional parameter. If no button has been clicked to close the toast (toast closed via a timer, click on the toast, parent window closed, etc.), this parameter is set to 0.
Integer or constantToast animation for closing the toast. This property can take the following values:
  • -1: No animation.
  • 0 (Default value): Default animation, defined in project options ("Field animations" button in the "Advanced" tab of the project description window).
  • animFade crossfade animation: toast opacity changes from 1 to 100%.
Attention This feature is only available in WINDEV Suite SaaS 2025 Update 2. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
Integer or constantToast animation for opening the toast. This property can take the following values:
  • -1: No animation.
  • 0 (Default value): Default animation, defined in project options ("Field animations" button in the "Advanced" tab of the project description window).
  • animFade crossfade animation: toast opacity changes from 100% to 1.
Attention This feature is only available in WINDEV Suite SaaS 2025 Update 2. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
IntegerRounding size to be applied to the corners of the toast. If this value is 0, the toast is rectangular.
By default, this property is set to 24.
Attention This feature is only available in WINDEV Suite SaaS 2025 Update 2. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
Button[n]Buttons displayed in the toast.
Button[n].ActionClickAction to perform when the button is clicked on.
This property corresponds to the name of the procedure to be executed when the button in the toast is clicked.
Button[n].CaptionButton caption.
Note: you can use the gPen function to change the color of the text displayed in the toast. For example:
MyToast.Button[3].Caption = gPen(LightYellow) + 
	"Don't ask again"
HorizontalAlignmentInteger constantHorizontal alignment of the toast, relative to the window:
  • chCenter (Default): Display the toast in the center of the window.
  • chRight Displays the toast on the right of the window.
  • chLeft Displays the toast on the left of the window.
VerticalAlignmentInteger constantVertical alignment of the toast, relative to the window:
  • cvBas (Default): Display the toast at the bottom of the window.
  • cvTop Display toast at the top of the window.
  • cvMiddle Displays the toast in the middle of the window.
BackgroundColorIntegerBackground color used to display toast. This parameter can correspond to:
DisplayDurationInteger constantToast display time:
  • toastCourt (Default): The toast will be displayed for a short period of time.
  • toastLong The toast will be displayed for a long period of time.
Note: The exact display time depends on the device used.
CloseOnClickBooleanToast closing mode:
  • True: The toast closes automatically if the user clicks on it,
  • False The toast closes after the specified display time.
Character stringPath to image displayed at top left of toast.
Attention This feature is only available in WINDEV Suite SaaS 2025 Update 2. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
IntegerMargin between edge of toast and edge of parent window (in pixels).
By default, this property is set to 8.
Attention This feature is only available in WINDEV Suite SaaS 2025 Update 2. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
OpacityIntegerToast opacity level. The value of this property is between 0 and 100:
  • 0, default: slightly transparent toast.
  • 1, transparent toast,
  • 100, toast completely opaque (no transparency).
OverlayableBoolean
  • True (default): If more than one toast is displayed, the toasts are stacked.
  • False If several toasts are displayed, the toasts are displayed one under the other (version 24 compatibility).
TextCharacter stringText displayed in the toast.
TitleCharacter stringToast title.
Remarks

WLanguage functions that use Toast variables

ToastDisplayDisplays a "Toast" message.
ToastDisplayIWOpens a toast whose content is based on an internal window.
Related Examples:
WD Toasts Training (WINDEV): WD Toasts
[ + ] This example shows how to use the ToastDisplay and ToastDisplayIW functions as well as Toast variables. A Toast is a temporary message used to inform the user without interrupting the application.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/08/2025

Send a report | Local help