diff --git a/ux components/dialogs/DialogExample/README.md b/ux components/dialogs/DialogExample/README.md index 78546e6a..b3f55810 100644 --- a/ux components/dialogs/DialogExample/README.md +++ b/ux components/dialogs/DialogExample/README.md @@ -16,13 +16,10 @@ In this example, and in the remaining dialog node class examples, we'll cause th **Basic Message Dialog Example** -``` - - - - + + ``` Note that most of the code in the component is there just to create and center a **Label** node with an instruction to press the **OK** remote key to show the dialog. Then we use an **onKeyEvent()** function to call `showdialog()` when the **OK** key is pressed: -``` -sub showdialog()` -` dialog = createObject("roSGNode", "Dialog")` -` dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png"` -` dialog.title = "Example Dialog"` -` dialog.optionsDialog = true` -` dialog.message = "Press * To Dismiss"` -` m.top.dialog = dialog` -`end sub +```brightscript +sub showdialog() + dialog = createObject("roSGNode", "Dialog") + dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png" + dialog.title = "Example Dialog" + dialog.optionsDialog = true + dialog.message = "Press * To Dismiss" + m.top.dialog = dialog +end sub ``` Again, the first step to show a dialog is to create a dialog node object, in this case, creating a **Dialog** node class object. The next step is configure the dialog node object. In this example, we set a custom background for the dialog, by setting the `backgroundUri` field to the location of a custom 9-patch PNG graphic image. Then we configure the dialog title by setting the string to be used as the value of the `title` field. We want users to be able to dismiss this dialog by pressing the **Options** remote key in addition to the default **Back** key, so we set the `optionsDialog` field value to true. And finally, we add the message we want to convey to users by setting the `message` field value to the string to be used (this example does not have much of a message, just a reminder that the **Options** remote key can be used to dismiss the dialog). So if you press the **OK** remote key as instructed, this is the dialog that is shown: -![img](https://sdkdocs.roku.com/download/attachments/4262970/dialogdoc.jpg?version=2&modificationDate=1472838198183&api=v2) \ No newline at end of file +![img](https://sdkdocs.roku.com/download/attachments/4262970/dialogdoc.jpg?version=2&modificationDate=1472838198183&api=v2)