Re: Where do the XS files get installed?

Hi Jason ,

Au jour dit , Wed, 5 Jun 2002 00:18:44 -0500 ,
"Jason Bodnar" <jason shakabuku org> s'exprima ainsi:

Where do the XS files get installed? I'd like to modify the GtkFileSelection
widget so you can have access to the history pulldown. It's accessible in the
C API but not the Perl API. I see a GtkFileSelection.xs in CVS but I don't see
it in the Mandrake perl-GTK RPM.
I think i can guess (;-) from your last two mails that you are a little bit concerned by the FileSelection 
widget at the moment .

AFAIK , you can access to each element of the FilSelection dialog widget as it is the custom with all the 
'packaged' widgets ( like the combo ) , by a simple $widget->element ( i.e. $fileselection->dir_list ) .

So , if you want to have the current value of the pulldown history :
$history=$fileselection->selection_text->get(); (as it is a simple Gtk::Label , but beware of the return 
value format , you will have to make split/ : /,$history , if you are interested just by the path . Make a 
print $history,"\n" in your script to check this )

Then if ( according to the reading of both your mails ) , your concern is to be able to select a directory , 
just add a signal to the FileSelection widget to make it insert in the bottom entry :
$fileselection->dir_list->signal_connect("select_row",sub{ #as it is in fact a simple CList
my $dirlist=shift;
my $fs=shift;
my $row=shift;
my $pulldown=$fs->selection_text;
my $entry=$fs->selection_entry;
my (undef,$text)=split/ : /,$pulldown->get();
},$fileselection); #not tested but works for sure if stripped from the small syntax errors i may have made 
... ;-)

Of course , you can make it shorter , i gave you the details to make you understand the process . I don't 
know if there are simpler ways to do this ( like a function that i don't know of ) but at least this comes 
with no hacking of the sources ( i'm reeeally not capabale of this ) and clearly explained in the great 
gtk-perl tutorial , looking both at the CList and the Fileselection sections .

'hope it helps !

D vid 

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