comp.lang.ada
 help / color / mirror / Atom feed
From: tolkamp <f.tolkamp@gmail.com>
Subject: Re: How to implement JEWL File dialogs?
Date: Thu, 28 Oct 2010 04:10:16 -0700 (PDT)
Date: 2010-10-28T04:10:16-07:00	[thread overview]
Message-ID: <2e224902-401a-41b5-870a-403b78b0d9e9@j18g2000yqd.googlegroups.com> (raw)
In-Reply-To: op.vk6ezpuzule2fv@garhos

On 26 okt, 11:22, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
wrote:
> Le Tue, 26 Oct 2010 10:25:44 +0200, tolkamp <f.tolk...@gmail.com> a écrit:
>
> > I try to implement an file selection window using Open_Dialog. Here is
> > the code:
>
> > My_File_Selection_Dialog : Open_Dialog_Type;
> > --
> > --
> > My_File_Selection_Dialog := Open_Dialog("file name");
> > end;
>
> > Nothing is displayed when this code is running. I expect an input file
> > selection window as described in section 6.3 of
> > JEWL.windows User Manual
>
> OK, I see. The spec in not clear enough I feel, I had to look at the  
> implementation to understand what is wrong.
>
> Here is : Open_Dialog does not open anything, this is just a kind of  
> constructor (bad name for a constructor). Think of it as if it was named  
> Initialize_Open_Dialog. The spec just says “-- create an open file dialog  
> with this title.”, but this ambiguous with such a name.
>
> Open_Dialog returns an instance of a File_Dialog_Type.
> File_Dialog_Type is derived from Common_Dialog_Type.
> Common_Dialog_Type has a method named Execute : function Execute (Dialog :  
> Common_Dialog_Type) return Boolean;
> There as well, the spec is lacking expressiveness, as it just say :
>
>     --  Execute (Dialog)      -- execute the dialog and return True if the  
> OK
>     --                        -- button was used to close the dialog and  
> False
>     --                        -- otherwise.
>
> Actually, I can tell you that this is this Execute method which display  
> the dialog (the spec does not say this, but it is what the implementation  
> actually do).
>
> So, you just have to invok Execute on the instance you created with  
> Open_Dialog.
>
> Tell if that works :)
>
> --
> Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
> les chiens.

Indeed when I add the function Execute(My_File_Selection_Dialog) the
expected File Dialog window is shown.
Now I can select the desired file and press button Open.
By adding the function Get_Name(My_File_Selection_Dialog) the selected
file can be used in the application.



      reply	other threads:[~2010-10-28 11:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26  8:25 How to implement JEWL File dialogs? tolkamp
2010-10-26  8:41 ` Yannick Duchêne (Hibou57)
2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
2010-10-28 11:10   ` tolkamp [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox