Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 22867 программистов и 1225 роботов. Сейчас ищут 759 программистов ...
Приступая к работе

Basic usage

Вернуться к: Примеры

This example is a PHP port of RedHat 'setup' utility dialog, executed in text mode.

Пример #1 Newt Usage Example

<?php
newt_init 
();
newt_cls ();

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

newt_get_screen_size ($rows$cols);

newt_open_window ($rows/2-17$cols/2-103417"Choose a Tool");

$form newt_form ();

$list newt_listbox (3210);

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 (512"Run Tool");
$b2 newt_button (2112"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);
?>


Вернуться к: Примеры

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware