/**
  * Constructor
  *
  * @param   util.ParamString p
  */
 public function __construct($p)
 {
     // Set up logger
     $l = Logger::getInstance();
     $this->cat = $l->getCategory();
     // Parse rc file if one is set
     if (!empty($this->rcfile)) {
         Gtk::rc_parse($this->rcfile);
     }
     // Create main window
     $this->create();
     $this->window->realize();
     // Connect destroy signal
     $this->window->connect('destroy', array($this, 'destroy'));
     $this->param = $p;
 }
Exemple #2
0
					$renames[$file] = $file_new;
				}
			}
			
			foreach($renames AS $key => $value){
				if (rename($folder . "/" . $key, $folder . "/" . $value)){
					$this->tv_files->get_model()->append(array($value));
				}else{
					$this->tv_files->get_model()->append(array($key));
				}
			}
		}
	}
	
	//Start program.
	require_once("knjphpframework/functions_knj_extensions.php");
	require_once("knjphpframework/functions_knj_os.php");
	require_once("knjphpframework/functions_treeview.php");
	
	if (!knj_dl("gtk2")){
		die("Could not load PHP-GTK2-module.\n");
	}
	
	if (knj_os::getOS() == "windows"){
		//Set Windows-skin if running Windows.
		Gtk::rc_parse("gtkrc");
	}
	
	$win_main = new WinMain();
	Gtk::main();
?>
Exemple #3
0
    $box2->set_border_width(10);
    $scrolled_window->add_with_viewport($box2);
    $box2->set_focus_vadjustment($scrolled_window->get_vadjustment());
    ksort($buttons);
    foreach ($buttons as $label => $function) {
        $button =& new GtkButton($label);
        if ($function) {
            $button->connect('clicked', $function);
        } else {
            $button->set_sensitive(false);
        }
        $box2->pack_start($button);
    }
    $separator =& new GtkHSeparator();
    $box1->pack_start($separator, false);
    $box2 =& new GtkVBox(false, 10);
    $box2->set_border_width(10);
    $box1->pack_start($box2, false);
    $button =& new GtkButton('close');
    $button->connect_object('clicked', array('gtk', 'main_quit'));
    $box2->pack_start($button);
    $button->set_flags(GTK_CAN_DEFAULT);
    $button->grab_default();
    $window->show_all();
}
Gtk::rc_parse(dirname($argv[0]) . '/testgtkrc');
create_main_window();
Gtk::main();
?>