From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada References: <5c2793ed$0$19300$e4fe514c@news.kpn.nl> In-Reply-To: Subject: Re: Gtk Ada Message box example Date: Mon, 31 Dec 2018 08:31:34 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0023_01D4A0E3.3D371F30" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Message-ID: <5c29c5d6$0$31513$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 3284a5f1.news.kpn.nl X-Trace: G=IcNYa0oZ,C=U2FsdGVkX1+4KsWUrzt/zVyPajeH5H6J4iLOwePN93o1PwaH/oqnVuazke/aJdy/SY7OWv8d9dmPchTWwTdeAxth5Luo0qqJnOH4XxDaOBA= X-Complaints-To: abuse@kpn.nl Xref: reader01.eternal-september.org comp.lang.ada:55134 Date: 2018-12-31T08:31:34+01:00 List-Id: Dit is een meerdelig bericht in de MIME-indeling. ------=_NextPart_000_0023_01D4A0E3.3D371F30 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit Thanks for the information. I just have remembered how it has to be done in Gtk and put in some standard package that wil position a message box with only one button which can do what I wanrted, just preenting a message L. Dries "Dmitry A. Kazakov" schreef in bericht news:q08683$ol5$1@gioia.aioe.org... On 2018-12-29 16:34, ldries46 wrote: > I am searching for an example of showing a message box in Gtk. > I have been programming in VC++ earlier and there it was simple tocreate a > message box because you only have to show it. > I just want a message box with a title, a message and one button "OK". If > possble an Icon "Warning" > both text items can be either in string format or in. > I do not want to use glade anymore since it cannot present ada programming > language anymore. > I just am glad with a link ho an example in Ada http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm Package Gtk.Missed, procedure Message_Dialog. Note it cannot be called from any Ada task other than the one running the GTK messages loop. For a procedure callable from any task see the package Gtk.Main.Router, procedure Say. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ------=_NextPart_000_0023_01D4A0E3.3D371F30 Content-Type: text/plain; format=flowed; name="message_box.adb"; reply-type=response Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="message_box.adb" pragma License(Unrestricted); --with Gtk; use Gtk; with Gtk.Window; use Gtk.Window; with Gtk.Dialog; use Gtk.Dialog; with Gtk.Message_Dialog; use Gtk.Message_Dialog; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Message_Box is procedure M_Box(Title : String; Text : String) is MessageBox : Gtk_Message_Dialog; begin MessageBox :=3D Gtk_Message_Dialog_New(null, 1, Message_Warning, Buttons_Close, Text); MessageBox.Set_Title(Title); if MessageBox.Run <=3D 0 then MessageBox.Destroy; end if; end M_Box; procedure M_Box(Title : UnBounded_String; Text : UnBounded_String) is begin M_Box(To_String(Title), To_String(Text)); end M_Box; procedure M_Box(Title : UnBounded_String; Text : String) is begin M_Box(To_String(Title), Text); end M_Box; procedure M_Box(Title : String; Text : UnBounded_String) is begin M_Box(Title, To_String(Text)); end M_Box; end Message_Box; ------=_NextPart_000_0023_01D4A0E3.3D371F30 Content-Type: text/plain; format=flowed; name="message_box.ads"; reply-type=response Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="message_box.ads" pragma License(Unrestricted); --with Gtk; use Gtk; with Gtk.Window; use Gtk.Window; with Gtk.Message_Dialog; use Gtk.Message_Dialog; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Message_Box is procedure M_Box(Title : String; Text : String); procedure M_Box(Title : UnBounded_String; Text : UnBounded_String); procedure M_Box(Title : UnBounded_String; Text : String); procedure M_Box(Title : String; Text : UnBounded_String); end Message_Box; ------=_NextPart_000_0023_01D4A0E3.3D371F30--