[gtkada] undefined behaviour in File_Selector?
Preben Randhol
randhol at pvv.org
Sun May 19 19:42:31 CEST 2002
I <xer-pil at terra.es> wrote on 19/05/2002 (14:37) :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Hi all!
>
> When selecting nothing in the File_Selection_Dialog called in this way:
>
> Put_Line
> ~ ("|"
> ~ & File_Selection_Dialog(Title => "Abrir Base de Datos") &
> ~ "|");
>
> it shows:
> |/home/sergio/work/|
The code below is not complete you have to fill in the blanks, but it
should show how I would do it. You need to put it in a callback. If you
need more complete code let me know.
with GNAT.OS_Lib;
-- Get the FileName
Hide (File_Selection_Dialog);
if GNAT.OS_Lib.Is_Directory (FileName) or
not GNAT.OS_Lib.Is_Regular_File (FileName) then
-- Tell user he has to choose a file
Show (File_Selection_Dialog);
else
-- OK it is a file so do your stuff :-)
end if;
--
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
«For me, Ada95 puts back the joy in programming.»
More information about the gtkada
mailing list