[Gambas-user] Console questions

Benoît Minisini gambas at ...1...
Fri May 7 11:15:30 CEST 2010


> Good morning folks,
> 
> Just playing around with console applications. Opened a new project and
> made a "Hello world". There are some questions...
> 
> About the GUI: When I press the Play button, I can't see anything (of
> course). But isn't this somewhat unlogical, I mean, I have to make a
> binary and start the binary from the command line in some terminal. Play
> should open a terminal, shouldn't it? Or should it simply be disabled?
> 

The output of your program goes to the IDE console. In Gambas 3, you can use a 
true terminal emulator for that instead, if you need.

> Is there something like CLS in a commandline app? How do other programs
> - like "top" for instance - handle this?

Special terminal commands like that are handled by special character sequences 
that depends on the type of the terminal.

There is a library on Unix named NCurses that abstracts that (with it you will 
have a "CLS" command for any kind of terminal), but there is no support for it 
in Gambas at the moment. So you have to send the special character sequences 
by yourself.

If someone wants to make a useful component in C/C++, NCurses is a good start!

> 
> If the application is opened in a terminal window within the GUI, the
> window can be changed during operation. Clever commandline applications
> will adapt their row/height ratio to this. How can I read the number of
> rows and columns?

This is handled by the ncurses library too.

Regards,

-- 
Benoît Minisini




More information about the User mailing list