Re: Directory/file browser as TreeView



* muppet <scott asofyet org> [2006-09-29 14:16]:
my $child = $tree_store->append(undef);
$tree_store->set($child, 0, '/', 1, '/');
add_to_tree($tree_store, $child, '/', '/');

For shame!  Use File::Spec to manipulate the paths portably!
:-)

Or Path::Class. 10Ã nicer than File::Spec and the entourage of
other path manipulation modules. Also has a direct tie-in for
doing I/O. Best module discovery of 2005 for me. Seriously, itâs
ridiculously much better than what we had before.

(Also, the I/O shortcuts API is not insane like IO::Allâs. Plus
IO::All doesnât help you at all with file paths.)


* Ratcliffe, Jeffrey (Peters) <Jeffrey Ratcliffe External eads com> [2006-09-29 14:20]:
use constant TRUE  => 1;
use constant FALSE => 0;

use Glib qw(TRUE FALSE);

OK. I had always assumed that this:
1. loaded Glib, taking time and memory.
2. amounted to the same thing anyway.

Err. Do you know how big constant.pm actually is? Ironically,
Glib.pm is required for Gtk2.pm and therefore loaded anyway,
whereas a basic Gtk2-Perl program does not load constant.pm. So
your misguided optimisation is actually a pessimisation.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]