Modifying sidebar of filechooser

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)
		}
	}
}

No, there are no functions.

The file chooser is a complex widget that provides a minimum UI for selecting files in dialogs; it’s not something that you programmatically access to change to fit your requirements, just like you cannot change the layout algorithm of a GtkBox, or you cannot change the behaviour of a GtkTreeView.

By poking at the internals you’re literally going to break every time we change the layout of the places side bar or of the file chooser widget; we offer no guarantees of stability of the internal details of a widget, especially not one as complex as the file chooser.

I strongly encourage you to write your own file selection widget, if you want to make it look and behave differently than the GTK one.

As a side note: please use markdown when writing your code fragments. They render horribly on the website.