themeChooser

From: Date: Mon, 14 Aug 2006 10:26:20 +0000
Subject: themeChooser
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7092@lists.php.net to get a copy of this message
I'm using this little piece of code to change theme on the fly :
class themeChooser{ function __construct(){
    $dialog = new GtkDialog( "Synthese", NULL, Gtk::DIALOG_MODAL,
                 array( Gtk::STOCK_CLOSE, Gtk::RESPONSE_CLOSE));
    $tree_model = new GtkTreeStore( Gtk::TYPE_STRING);
    $treeview = new GtkTreeView($tree_model);
    $cell_renderer = new GtkCellRendererText();
    $column = new GtkTreeViewColumn('Theme', $cell_renderer, 'text', 0);
    $treeview->append_column( $column);
    $selection = $treeview->get_selection();
    $selection->connect('changed', array( $this, 'test_on_ctree_select'));
        if ($dh = opendir(GTK::rc_get_theme_dir())) {
      for ( ;($file = readdir($dh)) !== false;) {
    if ($file == "." || $file == "..")
      continue;
    $tree_model->append( null, array($file));
      }
      closedir($dh);
    }
    $dialog->vbox->add($treeview);
    $dialog->show_all();
    $dialog->run();
    $dialog->destroy();
} function test_on_ctree_select($selection){
    list($model, $iter) = $selection->get_selected();
    if(!$iter)
      return;
    gtk::rc_parse_string('gtk-theme-name = "'.$model->get_value($iter,0).'"');
//     while(gtk::events_pending()) gtk::main_iteration();
//     gtk::rc_reparse_all();
} } $themeChooser = new themeChooser(); I download themes from art.gnome.org/themes/gtk2/
The problem is that I don't know where to find gtk-engine dll. With the ones I found (especially libpixmap.dll), this code works a moment and after two or more changes no more changing works. Does anybody can tell me where can I find correct dll engines ? Thanks in advance, Benjamin

« previous php.gtk.general (#7092) next »