I've been playing with the built-in "dialog" binary:
/ebrmain/cramfs/bin/dialog
I understand that a message box can be called via:
Code:
dialog n "title" "message" "b1" "b2" "b3"
The button pressed assigns 1, 2 or 3 to the variable
$?
Where
n determines an icon to be shown by choosing 1-5:
- i - info icon
- ? - questionmark icon
- ! - exclamation mark icon
- X - error icon
- WIFI icon
Any number that's not 1-5 will not display an icon.
I'm not sure what the title field does, as entering anything here isn't displayed on the message box itself. My guess is that it's a title for the individual message box process?
The message field is self-explanatory and no problems there.
You can display up to 3 buttons. BUT even if you don't specify any buttons at all (blank line after message) if defaults to a single button. I'm sure I have seen system apps use dialog messages without a button, so I'm thinking there must be a parameter for this? Does anybody know what it might be, or how I could find out? I've examined the ELF binary via a hex editor and via dumpelf but haven't been able to glean any insight.
EDIT:
rkomar pointed me in the right direction, the dialog binary uses the "dialog" inkview function which requires at least one button. The "message" function has a timeout and no buttons.
Message (int icon, char *title, char *text, int timeout)
Dialog (int icon, char *title, char *text, char *button1, char *button2, iv_dialoghandler hproc)