Tiny Core Base > TCB Bugs
popask "NO" values differ in keyboard
PDP-8:
TinyCorePure64 10.1 :
If you aren't using a mouse to click on yes / no, but instead are using the return key OR the space key to register a "NO", they return different values. Use TAB to navigate to "no" button.
Example:
popask using the return/enter key to register a "yes" = 1
popask using the SPACE key to register a "yes" =1
Fine.
Use the TAB key to navigate to NO button.
popask using return/enter to register "no" = 1
popask using SPACE key to register "no" = 0
So, not a showstopper, BUT in the hands of the unskilled who might just actually use the space/return keys instead of a mouse, may result in unintended actions.
Rich:
Hi PDP-8
It seems it's not a bug:
--- Quote ---Description
Displays a printf-style message in a pop-up box with an "Yes" and "No" button and waits for the user to hit a button. The return value is 1
if the user hits Yes, 0 if they pick No or another dialog box is still open. The enter key is a shortcut for Yes and ESC is a shortcut for No.
Note: Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for
additional dialog boxes are ignored.
--- End quote ---
Found here:
https://www.fltk.org/documentation.php/doc-1.1/functions.html#fl_ask
pek:
Hi guys,
How to catch the Yes No output?
I tried
I always get No - regardless I clicked yes or no
Rich:
Hi pek
Check out xmessage. It's part of Xorg-7.7-bin.tcz. Example:
--- Code: ---tc@E310:~$ xmessage -buttons Yes:1,No:2,Maybe:3 -print -center "Hello, World!"
Maybe
tc@E310:~$ echo $?
3
tc@E310:~$
--- End code ---
This tells xmessage to create a popup with 3 buttons, Yes, No, and Maybe.
The numbers are the exit code you want for each button. The exit code can be found in $?
The -print option tells it to print the name of the button selected.
The -center option tells it to place the popup in the center of the screen.
Just entering xmessage produces a help screen.
pek:
Hi Rich..
Sorry I was asking about popask.
I don't have xorg, only xfbdev. So I don't have xmessage either.
Back to popask..
--- Code: ---popask
clicked yes.. gives 1
--- End code ---
and
--- Code: ---popask
clicked no.. gives 0
--- End code ---
How to catch that 1 or 0 so I can make and if loop?
Thanks.
Navigation
[0] Message Index
[#] Next page
Go to full version