Hi
Are there any functions for modifying the default sidebar for the filechooser widget, removing unwanted shortcuts etc
In my app I have the following code ( I only want defined directories to be shown), not elegant I know
This is on the create filechooser sub routine
This populates with the list that I want to show
if ($sopts->{subname} && $sopts->{subname} eq ‘encodefiles’){
my $folders=$dbh->selectcol_arrayref(‘SELECT dir FROM dirctl WHERE dirtype IN (‘dir’,‘source’,‘src’)’);
foreach my $s (@{$folders}){
$selw{selw}->add_shortcut_folder($s)
}
This gets the list of row objects
my @r= (((((($selw{selw}->get_children)[0]->get_children)[0]->get_children)[0])->get_children)->get_children)[0]->get_children;
This gets the listbox that the row objects are contained in
my $listbox= (((((($selw{selw}->get_children)[0]->get_children)[0]->get_children)[0])->get_children)->get_children)[0];
foreach my $r (@r){
my $name; ## variable for name of directory in sidebar
{
my @r= $r->get_children;
foreach my $rev (@r){
my $e= ($rev->get_children)[0];
my $b=($e->get_children)[0];
foreach my $w ($b->get_children){
$name=$w->get_text if $w=~/Label/;
}
}
}
remove if not in regular expression
if ($name!~/(?:Filesystem root|Home|Other Locations)/){
$listbox->remove($r)
}
}
}