Re: Fileselection question



On Wednesday, July 9, 2003, at 05:58  PM, Pascal wrote:

Having seen your code, I can tell you that you can do it with the following :

        $file_dialog->ok_button->signal_connect( "clicked", sub {
$fichier = $file_dialog->get_filename(), $file_dialog->hide(), print "$fichier\n"});

$file_dialog->cancel_button->signal_connect( "clicked", sub { $file_dialog->hide() } );

<gtk2 specific>
i would warn against connecting directly to the cancel and ok buttons... use the response callback of the dialog instead. this allows you to hook into the user clicking OK, Cancel, killing the window, or hitting Escape, all from the same function.
</gtk2 specific>




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