Post Reply 
How Drawmenu work's?
11-12-2016, 08:36 PM (This post was last modified: 11-12-2016 08:39 PM by primer.)
Post: #12
RE: How Drawmenu work's?
(11-12-2016 02:53 PM)compsystems Wrote:  To exit the menu, you have to press the [on] key, then "Program interrupted" =(
ho.. I see what you mean. but it's not to "exit the menu", it's to exit the WHILE loop, wich is not part of the lib itself.
I'm sorry, but it's a misunderstanding of the purpose of LibMenu.
The WHILE loop is on the side of the program developer (you), nothing is implemented in LibMenu for that.

You have to build your own loop, it's up to you to decide how user can quit (on ESC key press or else ?) I can't do that choice for you : it's your program.

There are many way to handle that.
For example :
Code:
local stay:=1;
EXPORT quit()
BEGIN
 stay:=0; // you will quit nicely the WHILE loop
END;

EXPORT MainProgr()
BEGIN
...
LibMenu.entry(6,"exit","quit()");
...
WHILE stay DO
 LibMenu.events();
END;

As it is, LibMenu does not stop program execution, then I can't propose a way to "exit the menu" as you asked.
Why did I make that choice : to let more freedom to people that use LibMenu, their program are not waiting for user interaction, program continue to run, it can be helpfull for a game for example...


(11-12-2016 02:53 PM)compsystems Wrote:  There is a problem, when the menu is on the terminal view. The menu is not updated

It's not a problem of the lib, but a problem of the program that use it.
Your program perform a wait() just after a print() : you are displaying the terminal and stop program execution, what did you expect ? Wink

I provided you in that lib a method to refresh your menu : LibMenu.draw().
Feel feel to place a LibMenu.draw() just before your wait().

Every time you clean the screen, it's up to you to redraw the menu.

primer
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How Drawmenu work's? - fabio.hdl - 11-03-2016, 05:02 PM
RE: How Drawmenu work's? - Han - 11-03-2016, 06:41 PM
RE: How Drawmenu work's? - Tyann - 11-03-2016, 07:02 PM
RE: How Drawmenu work's? - StephenG1CMZ - 11-03-2016, 08:58 PM
RE: How Drawmenu work's? - toml_12953 - 11-04-2016, 02:28 PM
RE: How Drawmenu work's? - primer - 11-11-2016, 07:31 PM
RE: How Drawmenu work's? - fabio.hdl - 11-05-2016, 08:22 PM
RE: How Drawmenu work's? - compsystems - 11-12-2016, 01:36 AM
RE: How Drawmenu work's? - primer - 11-12-2016, 10:41 AM
RE: How Drawmenu work's? - compsystems - 11-12-2016, 02:53 PM
RE: How Drawmenu work's? - primer - 11-12-2016 08:36 PM
RE: How Drawmenu work's? - StephenG1CMZ - 11-12-2016, 08:23 AM
RE: How Drawmenu work's? - compsystems - 11-12-2016, 09:05 PM
RE: How Drawmenu work's? - primer - 11-12-2016, 10:04 PM
RE: How Drawmenu work's? - compsystems - 11-14-2016, 04:03 AM
RE: How Drawmenu work's? - StephenG1CMZ - 11-14-2016, 09:03 AM
RE: How Drawmenu work's? - ggauny@live.fr - 01-25-2017, 12:11 PM
RE: How Drawmenu work's? - ggauny@live.fr - 01-25-2017, 05:06 PM
RE: How Drawmenu work's? - primer - 01-25-2017, 11:18 PM



User(s) browsing this thread: 1 Guest(s)