comp.lang.ada
 help / color / mirror / Atom feed
* Modal dialogs with GtkAda
@ 2001-01-02 11:40 Florian Weimer
  2001-01-02 13:41 ` Emmanuel Briot
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2001-01-02 11:40 UTC (permalink / raw)


How can I create modal dialogs with GtkAda?  Okay, I can use
Set_Modal, but this doesn't result in the convenient programming
interface modal dialogs have with some other widget sets.  More
precisely, I want to do the following:

        declare
           Result   : Dialog_Result;
           Name     : Unbounded_String;
           Quantity : Long_Float;

        begin
           Query_User_With_Dialog (Result, Name, Quantity);
           
           case Result is
              when Ok =>
                 Add_To_Database (Name, Quantity);
           
              ...
           end case;
        end;

Query_User_With_Dialog should not return while the dialog is
visible on the screen.  Is there are simple way to implement
Query_User_With_Dialog?

(Another question: Is there any documentation on memory management and
GtkAda, e.g. do I have free components of a window, entries in a Clist,
etc.?)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modal dialogs with GtkAda
  2001-01-02 11:40 Modal dialogs with GtkAda Florian Weimer
@ 2001-01-02 13:41 ` Emmanuel Briot
  2001-01-02 21:47   ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Emmanuel Briot @ 2001-01-02 13:41 UTC (permalink / raw)



> How can I create modal dialogs with GtkAda?  Okay, I can use
> Set_Modal, but this doesn't result in the convenient programming
> interface modal dialogs have with some other widget sets.  More
> precisely, I want to do the following:
>       [...]
> Query_User_With_Dialog should not return while the dialog is
> visible on the screen.  Is there are simple way to implement
> Query_User_With_Dialog?


We have implemented exactly that kind of dialog in the package
Gtkada.Dialogs and Gtkada.File_Selection. These packages provides two
functions that do not return until the user closes the dialog (either
by clicking on the buttons or simply by closing the window).
If you can use these in your application, do it directly. If these
dialogs are not quite what you want, look at the source and do the
same thing for your dialog. This is one of the strong aspects of
free-software :-)

> (Another question: Is there any documentation on memory management and
> GtkAda, e.g. do I have free components of a window, entries in a
Clist,
> etc.?)


Read the secret documentation: the GtkAda user's guide as a full
paragraph on that. The short asnwer is: No, you don't need to free
the memory yourself, this is all taken care of.

regards,
Emmanuel
ACT-Europe


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modal dialogs with GtkAda
  2001-01-02 13:41 ` Emmanuel Briot
@ 2001-01-02 21:47   ` Florian Weimer
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2001-01-02 21:47 UTC (permalink / raw)


Emmanuel Briot <briot@gnat.com> writes:

> > Query_User_With_Dialog should not return while the dialog is
> > visible on the screen.  Is there are simple way to implement
> > Query_User_With_Dialog?
> 
> 
> We have implemented exactly that kind of dialog in the package
> Gtkada.Dialogs and Gtkada.File_Selection. These packages provides two
> functions that do not return until the user closes the dialog (either
> by clicking on the buttons or simply by closing the window).

Ah, thanks.  I think I really have to upgrade my GtkAda installation;
mine lacks Gtkada.Dialogs, GtkAda.File_Selection and the 'Memory
Management' section in the documentation.  Thanks.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-02 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-02 11:40 Modal dialogs with GtkAda Florian Weimer
2001-01-02 13:41 ` Emmanuel Briot
2001-01-02 21:47   ` Florian Weimer

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