Friday, 18 July 2014

Application Development : System Dialogs, Prompts, and Toasts – SystemToast

SystemToast
A toast is a simple pop-up message that is displayed for a predefined amount of time. The toast is for information purposes only and the user does not need to interact with it. Listing 4 shows you how to use a SystemToast to display a toast to the user.
Listing 4.  SystemToast
import bb.cascades 1.2
import bb.system 1.2
 
Page {
    Container {
        layout: DockLayout {
        }
        Button {
            text: "Show Dialog!"
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Center
            onClicked: {
                myToast.show();
            }
        }
        attachedObjects: [
            SystemToast {
                id: myToast
                body: "Happy New Year!"
            }
        ]
 
    }
}

No comments:

Post a Comment