View Single Post
Old 04-20-2023, 12:06 PM   #1
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,892
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
dialog - ELF binary - Parameter for no buttons?

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:
  1. i - info icon
  2. ? - questionmark icon
  3. ! - exclamation mark icon
  4. X - error icon
  5. 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)

Last edited by neil_swann80; 04-25-2023 at 12:13 AM.
neil_swann80 is offline   Reply With Quote