GtkCTree
| From: | Ivan Rodriguez | Date: | Sun, 23 Mar 2003 20:10:11 +0000 |
| Subject: | GtkCTree | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-3146@lists.php.net to get a copy of this message | ||
Hi people :-)
I have one question, I'm trying to do a directory tree, but I have a
problem, I can't to relate the handle directory with the successive dirs
:-(, I have this code:
function listarDir($dir)
{
$arrayDir = array();
$arrayFiles = array();
$handle = opendir($dir);
while ($siguiente = readdir($handle))
{
if (($siguiente != ".") && ($siguiente != "..") &&
is_dir($dir."/".$siguiente))
{
$arrayDir[] = $dir."/".$siguiente;
}
elseif (is_file ($dir."/".$siguiente))
{
$arrayFiles[] = $dir."/".$siguiente;
}
}
if($arrayDir)
{
foreach($arrayDir as $dirs)
{
//echo $dirs . "<DIR> \r\n";
list ($func, $func_mascara) = Gdk::pixmap_create_from_xpm
($this->programa->gui['Gtk_Window']->window, NULL,
dirname(__FILE__)."/imagenes/dir.xpm");
$parent = $this->gui['Gtk_Proyectos_Archivos']->insert_node (NULL,
NULL,array($dirs), 1, $func,$func_mascara,$func,$func_mascara,false,
false);
$this->listarDir($dirs);
}
}
if($arrayFiles)
{
foreach($arrayFiles as $files)
{
//echo "\t" . $files . "<FILE> \r\n";
list ($func, $func_mascara) = gdk::pixmap_create_from_xpm
($this->programa->gui['Gtk_Window']->window, NULL,
dirname(__FILE__)."/imagenes/nuevo_ar.xpm");
$node = $this->gui['Gtk_Proyectos_Archivos']->insert_node ($parent,
NULL,array($diles), 1, $func,$func_mascara,$func,$func_mascara,false,
false);
}
}
closedir($handle);
}
How can I get directory tree In GtkCtree widget?¿
thx.
Regards Ivan.