You are not logged in.

#1 2019-03-24 15:16:27

RankoKohime
Member
Registered: 2014-01-08
Posts: 87
Website

dialog (in bash)

Because of it's rather search-unfriendly generic name, information for the dialog program, i.e. this: http://linuxcommand.org/images/adventur … ialog1.png , is just a bit difficult to come by, so hopefully someone here has experience with dialog and knows the answers to my question that Google seems to guard closely.  yikes

Is there a way, when making a menu, to not require the Enter key to be pressed, but rather just the letter/number assigned to the entry?  I've been doing this in bash using:

read -n 1 $opt

but I can't seem to find a setting for dialog.

In the same vein, (a menu) (or would this be a capillary?) is there a setting to make the menu automatically resize to the entries passed, rather than having to manually define the box sizes?

Last edited by RankoKohime (2019-03-24 15:18:30)

Offline

#2 2019-03-24 15:27:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: dialog (in bash)

I don't believe there is a way to get a single key press in a menu.  But why use dialog for this at all of this is what you want?

As for the sizing:

man dialog wrote:

       Most widgets accept height and width parameters, which can be used to automatically size the widget to accommodate multi-line message prompt values:
...
       ·   If the parameter is zero, dialog uses minimum size for the widget to display the prompt and data.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-03-24 23:08:40

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: dialog (in bash)

Your first Q. I second Trilby on that one, at least never seen it.
The second, try and give all measures a '0' like so:

$dialog  --title "sizing the dialog" --menu "--Your menu-- " 0 0 0 \

Offline

#4 2019-03-28 03:34:41

RankoKohime
Member
Registered: 2014-01-08
Posts: 87
Website

Re: dialog (in bash)

Trilby wrote:

I don't believe there is a way to get a single key press in a menu.  But why use dialog for this at all of this is what you want?

As for the sizing:

man dialog wrote:

       Most widgets accept height and width parameters, which can be used to automatically size the widget to accommodate multi-line message prompt values:
...
       ·   If the parameter is zero, dialog uses minimum size for the widget to display the prompt and data.

I'm testing out dialog as a replacement to the hand-coded menu I'm currently using, to reduce time spent tweaking.

As for the sizing, thanks, I must have overlooked that part of the manpage.  smile

Last edited by RankoKohime (2019-03-28 03:37:00)

Offline

#5 2019-03-28 04:16:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: dialog (in bash)

RankoKohime, In case you were wondering, You left a report for the moderators rather than replying.  It looks like you did a good job of reposting the data pretty much verbatim.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2019-03-28 05:18:38

RankoKohime
Member
Registered: 2014-01-08
Posts: 87
Website

Re: dialog (in bash)

ewaller wrote:

RankoKohime, In case you were wondering, You left a report for the moderators rather than replying.  It looks like you did a good job of reposting the data pretty much verbatim.

I did indeed.  I realized that after submitting it.  Either I need new glasses, or a custom CSS for this forum.  Or probably both.  smile

Offline

Board footer

Powered by FluxBB