Results 1 to 6 of 6

Thread: What is Newt in PHP?

  1. #1
    Join Date
    Jun 2009
    Posts
    230

    What is Newt in PHP?

    Hi friends,
    I have done coding in PHP to some extent, so you can say that I am having a bit knowledge of PHP programming language. Now recently I was going through the tutorials and I found the Newt in PHP. I thought that it would be better to ask you guys because you explain the things properly. So please tell me what is the Newt in PHP? Any other information regarding the topic would be grateful.

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: What is Newt in PHP?

    This is a PHP language extension for RedHat Newt library, a window-based terminal and a widget library for writing applications with user friendly interface. Once this extension is enabled in PHP, you'll the possibility of using widgets, such as windows, buttons, check boxes, radio boxes, labels, text boxes, scroll bars, large text boxes, rules, etc.. The use of this extension is very similar to the original Newt API of C programming language. This extension PECL is not bundled with PHP. In PHP 4, the sources of this PECL extension may be found in the ext / directory within the PHP source.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: What is Newt in PHP?

    This extension uses two resource types, which are as follows :
    • newt component
    • newt grid
    The resource type "newt component" is returned by functions, which create common newt widgets (eg newt_button ()). The resource type "newt grid" is a special link to the identifiers of components returned by the object class of newt grid.

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

    Re: Predefined Constants of Newt in PHP

    The following are the Predefined Constants of the Newt in PHP :
    1. Newt colorsets - The following are some colorsets :
      • NEWT_COLORSET_ROOT
      • NEWT_COLORSET_BORDER
      • NEWT_COLORSET_WINDOW
      • NEWT_COLORSET_SHADOW
    2. Newt argument flags - The following are the argument flags of Newt :
      • NEWT_ARG_LAST
      • NEWT_ARG_APPEND
    3. Newt Components Flags - The following is the list of the same :
      • NEWT_FLAG_RETURNEXIT
      • NEWT_FLAG_HIDDEN
      • NEWT_FLAG_SCROLL
      • NEWT_FLAG_DISABLED

  5. #5
    Join Date
    Jul 2006
    Posts
    289

    Re: What is Newt in PHP?

    The following are some functions of the Newt that is being used in PHP :
    • newt_bell - This function send a beep to the terminal.
    • newt_button_bar - This function returns a grid containing the buttons created.
    • newt_button - This function creates a new button.
    • newt_centered_window - This function open a centered window of the specified size.
    • newt_checkbox_get_value - This function get the value of the resource box to tick.
    • newt_checkbox_set_flags - This function configure a resource mailbox to check.
    Signatures reduce available bandwidth

  6. #6
    Join Date
    Nov 2008
    Posts
    996

    Re: What is Newt in PHP?

    I have provided you with an example so that you can understand the concept clearly. So just have a glance at the following example :
    PHP Code:
    <?php 
    newt_init 
    (); 
    newt_cls (); 

    newt_draw_root_text "Test Mode Setup Utility 1.12" ); 
    newt_push_help_line null ); 
    newt_draw_root_text (- 30 "1999-2002 RedHat, Inc" ); 

    newt_get_screen_size $rows $cols ); 

    newt_open_window $rows 17 $cols 10 34 17 "Choose a Tool" ); 

    $form newt_form (); 

    $list newt_listbox 10 ); 

    foreach (array ( 
    "Authentication configuration" 
    "Firewall configuration" 
    "Mouse configuration" 
    "Network configuration" 
    "Printer configuration" 
    "System services" ) as $l_item 

    newt_listbox_add_entry $list $l_item $l_item ); 


    $b1 newt_button 12 "Run Tool" ); 
    $b2 newt_button 21 12 "Quit" ); 

    newt_form_add_component $form $list ); 
    newt_form_add_components $form , array( $b1 $b2 )); 

    newt_refresh (); 
    newt_run_form $form ); 

    newt_pop_window (); 
    newt_pop_help_line (); 
    newt_finished (); 
    newt_form_destroy $form ); 
    ?>

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,192,681.61706 seconds with 15 queries