Results 1 to 6 of 6

Thread: What are the Functions Control Terminal Screen in PHP?

  1. #1
    Join Date
    Jun 2009
    Posts
    360

    What are the Functions Control Terminal Screen in PHP?

    Hi friends,
    I have done basic coding in PHP programming language. I have used many basic functions while doing the coding. Now recently I have gone through the term of functions control terminal screen, which I have never heard before. So thought that you guys may help me in this topic. Please explain me what are the Functions Control Terminal Screen in PHP? Hope that someone will help me soon.!!

  2. #2
    Join Date
    Jul 2006
    Posts
    442

    Re: What are the Functions Control Terminal Screen in PHP?

    ncurses (new curses, new sliders) are a free cursors emulation of System V Rel 4.0 (and higher). It uses terminfo format, supports numeric keypads, colors, multiple colors, the characters of form and function keys. Through the interactive nature of the library, there is no question of the use to write applications for the Web but, cons, it can be very interesting to write scripts on the command line. The features available, such as colors, depending on the terminal you are using. Use functions such as ncurses_has_colors (), ncurses_can_change_color () and ncurses_has_ic () to check the capabilities of your.
    "When they give you ruled paper, write the other way..." J.R.J.

  3. #3
    Join Date
    Jul 2006
    Posts
    286

    Re: What are the Functions Control Terminal Screen in PHP?

    The following is the coding for writing a string with a specified color to the screen :
    PHP Code:
    <?php 
    ncurses_init 
    (); 

    if ( 
    ncurses_has_colors ()) { 
    ncurses_start_color (); 
    ncurses_init_pair NCURSES_COLOR_GREEN NCURSES_COLOR_BLUE ); 
    ncurses_color_set ); 


    ncurses_mvaddstr 15 15 "Hello world! Green on blue text!" ); 

    ncurses_refresh (); 

    ncurses_end (); 
    ?>
    IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....

  4. #4
    Join Date
    Aug 2006
    Posts
    227

    Re: What are the Functions Control Terminal Screen in PHP?

    In case of error ncurses functions return -1. Some functions return 0 on success. The following are the Ncurses color constants :
    • NCURSES_COLOR_BLACK - No color
    • NCURSES_COLOR_WHITE - white
    • NCURSES_COLOR_RED - Red: supported when terminal is in color mode
    • NCURSES_COLOR_GREEN - Green supported when terminal is in color mode
    • NCURSES_COLOR_YELLOW - Yellow: supported when terminal is in color mode
    • NCURSES_COLOR_BLUE - Blue: supported when terminal is in color mode
    I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.

  5. #5
    Join Date
    Mar 2008
    Posts
    349

    Re: What are the Functions Control Terminal Screen in PHP?

    I have provided you with a Ncurses key constants, which can be very useful in doing the coding. The following are the Ncurses key constants :
    • NCURSES_KEY_F0 - NCURSES_KEY_F64
    • NCURSES_KEY_DOWN
    • NCURSES_KEY_UP
    • NCURSES_KEY_RIGHT
    • NCURSES_KEY_LEFT
    • NCURSES_KEY_BACKSPACE
    • NCURSES_KEY_HOME
    • NCURSES_KEY_IL
    • NCURSES_KEY_IC
    • NCURSES_KEY_CLEAR

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    Re: What are the Functions Control Terminal Screen in PHP?

    While doing the functions control you should also be having knowledge about the Mouse constants. The following is the list of the mouse constants that are commonly used :
    • NCURSES_BUTTON1_RELEASED - NCURSES_BUTTON4_RELEASED
    • NCURSES_BUTTON1_PRESSED - NCURSES_BUTTON4_PRESSED
    • NCURSES_BUTTON1_CLICKED - NCURSES_BUTTON4_CLICKED
    • NCURSES_BUTTON1_DOUBLE_CLICKED - NCURSES_BUTTON4_DOUBLE_CLICKED
    • NCURSES_BUTTON1_TRIPLE_CLICKED - NCURSES_BUTTON4_TRIPLE_CLICKED
    • NCURSES_ALL_MOUSE_EVENTS
    • NCURSES_REPORT_MOUSE_POSITION

Similar Threads

  1. How to control VLC through terminal while playing media?
    By Borislav in forum Windows Software
    Replies: 5
    Last Post: 10-07-2011, 10:59 AM
  2. Many functions are missing in Sony VAIO control center.
    By Kapaali in forum Portable Devices
    Replies: 5
    Last Post: 03-05-2011, 10:18 AM
  3. Replies: 5
    Last Post: 22-08-2010, 02:39 AM
  4. screen brightness control
    By SinguIar in forum Windows XP Support
    Replies: 2
    Last Post: 17-04-2010, 06:58 AM
  5. Replies: 2
    Last Post: 29-03-2007, 06:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,047,693.10567 seconds with 17 queries