res = SystemRequest(title$, body$, buttons$[, icon])
buttons$
. Separate the buttons specified in
buttons$
by a "|". The return value tells you which button the user has
pressed. Please note that the right most button always has the value of
False
(0) because it is typically used as the "Cancel" button. For example,
if you have three buttons "One|Two|Three", button "Three" has a return value
of 0, "Two" returns 2, and "One" returns 1.
New in Hollywood 4.0: You can use the optional argument icon to add a little icon to the requester. The following icons are possible:
#REQICON_NONE:
#REQICON_INFORMATION:
#REQICON_ERROR:
#REQICON_WARNING:
#REQICON_QUESTION:
Please note that currently requester icons are not supported on every platform that Hollywood runs on.
Starting with Hollywood 6.0, SystemRequest()
might map the following
button specifications to certain system-specific buttons: "OK", "OK|Cancel",
"Yes|No" and "Yes|No|Cancel". This means that it could happen that the buttons
suddenly appear in the user's language instead of the English versions
you passed to SystemRequest()
. It can also mean that the order of the
buttons is changed, e.g. on macOS the "OK" button is typically placed
to the right of the "Cancel" button whereas on other systems it is the
other way round. Nevertheless, the return values will always be consistent,
i.e. "OK" or "Yes" will always have a return value of 1 whereas "Cancel"
or "No" has a return value of 0 the only exception being "Yes|No|Cancel"
where "No" has a return value of 2 because there is also a "Cancel" button
which has a return value of 0.
Also, it is possible to pass an empty string ("") in the first parameter since Hollywood 6.0. In that case, the requester will use the title specified in the @APPTITLE preprocessor command.
#REQICON_NONE
) (V4.0)sel = SystemRequest("Pizza Service", "Select your pizza!", "Prosciutto e funghi|Calzone|Margerita|Hawaii") Switch sel Case 1: Print("1x Prosciutto e funghi = 8 Euro") Case 2: Print("1x Calzone = 10 Euro") Case 3: Print("1x Margerita = 9 Euro") Case 0: Print("1x Hawaii = 12 Euro") EndSwitchThe above code asks the user for a pizza and displays the price of that pizza.