{"id":81,"date":"2014-09-08T21:35:43","date_gmt":"2014-09-09T04:35:43","guid":{"rendered":"http:\/\/appinventor.pevest.com\/?p=81"},"modified":"2014-09-08T21:35:43","modified_gmt":"2014-09-09T04:35:43","slug":"display-warning-and-alert-box-messages-in-app-inventor-apps","status":"publish","type":"post","link":"https:\/\/coldstreams.com\/appinventor\/2014\/09\/08\/display-warning-and-alert-box-messages-in-app-inventor-apps\/","title":{"rendered":"Display &#8220;Warning&#8221; and &#8220;Alert&#8221; box messages in App Inventor apps"},"content":{"rendered":"<p>Whether you use Windows, Linux or Mac OS X applications, when the program needs to alert the user (you!) to an issue, the program displays a pop up dialog box with a warning or error message. You can easily create similar warning messages in App Inventor, as shown in this example screen:<\/p>\n<p><a href=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/Screenshot_2014-09-08-14-05-48.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-83\" src=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/Screenshot_2014-09-08-14-05-48-576x1024.png\" alt=\"Screenshot_2014-09-08-14-05-48\" width=\"360\" height=\"640\" \/><\/a><\/p>\n<p>To create a pop up warning dialog, use the <em>Notifier<\/em> control that appears in the Designer&#8217;s Palette:<\/p>\n<p><a href=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyPalette.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-82\" src=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyPalette.png\" alt=\"NotifyPalette\" width=\"284\" height=\"640\" \/><\/a><\/p>\n<p>Drag the Notifier icon into the app user interface design &#8211; the Notifier is used\u00a0as a non-visible component, just below the user interface:<\/p>\n<p><a href=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyDesignerView.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84\" src=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyDesignerView.png\" alt=\"NotifyDesignerView\" width=\"700\" height=\"188\" \/><\/a><\/p>\n<p>Switch to the Blocks view, click on the Notifier1 block to view the available methods. A partial list of methods is shown here &#8211; the item circled in red is the one we will use in this example:<\/p>\n<p><a href=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifierMethods.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-85\" src=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifierMethods-500x1024.png\" alt=\"NotifierMethods\" width=\"313\" height=\"640\" \/><\/a><\/p>\n<p>In response to an on screen button press (<em>btnNotifyUser&#8217;s<\/em> <em>Click<\/em> event), the app displays the dialog message:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyBlockCode.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-86\" src=\"http:\/\/appinventor.pevest.com\/wp-content\/uploads\/2014\/09\/NotifyBlockCode-1024x383.png\" alt=\"NotifyBlockCode\" width=\"625\" height=\"233\" \/><\/a>This block can be inserted anywhere a processing block is allowed such as the result of an if-then-else conditional block. You can also change the text or background color of the app to something more interesting than the &#8220;black and white&#8221; default colors shown in this example.<\/p>\n<p><em>Notifier<\/em> provides a quick and easy way to display short alert messages to the user of the app.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whether you use Windows, Linux or Mac OS X applications, when the program needs to alert the user (you!) to an issue, the program displays a pop up dialog box with a warning or error message. You can easily create similar warning messages in App Inventor, as shown in this example screen: To create a &hellip; <a href=\"https:\/\/coldstreams.com\/appinventor\/2014\/09\/08\/display-warning-and-alert-box-messages-in-app-inventor-apps\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Display &#8220;Warning&#8221; and &#8220;Alert&#8221; box messages in App Inventor apps<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6,13],"tags":[],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-components","category-documentation","category-tips"],"_links":{"self":[{"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":0,"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coldstreams.com\/appinventor\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}