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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2746dae4f161c04e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-21 01:38:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Gtkada-Prob Date: Wed, 21 Nov 2001 09:38:10 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <20011121.053507.496987743.3460@web.de> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1006335490 29084 129.241.83.82 (21 Nov 2001 09:38:10 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 21 Nov 2001 09:38:10 +0000 (UTC) User-Agent: slrn/0.9.7.2 (Linux) Xref: archiver1.google.com comp.lang.ada:16776 Date: 2001-11-21T09:38:10+00:00 List-Id: On Wed, 21 Nov 2001 05:35:08 +0100, Lars Heppler wrote: > Hi! > I have a little problem, i want to write a gtkada-programm, where you can > select some options with Radiobuttons and Checkbuttons. Do I need a > Handler to find out if the bottons are active or not ? I used Glade to > make the gui. Yes. You need a handler. As Radio and checkbuttons are derivatives from toggle button and do not have additional signals of their own, you use the "toggled" signal inherited from toggle buttons. What I did with some radio buttons I have was to make an Enumerated type : type Method_Enum_Type is (Spell, MultipleChoice, Noun); and I defind a Callback package like this: package Method_Callback is new Gtk.Handlers.User_Callback (Gtk_Radio_Button_Record, Method_Enum_Type); I then hooked the radio buttons to the the "toggled" signal as: Method_Callback.Connect (Gui_Setup.Spell_R_Button, "toggled", Method_Callback.To_Marshaller (On_Method_Radio_Button_Toggle'Access), Spell); This means that if this button is toggled it will send Spell as the user data to the On_Method_Radio_Button_Toggle procedure which I wrote like this: procedure On_Method_Radio_Button_Toggle (Object : access Gtk_Radio_Button_Record'Class; Method : Method_Enum_Type) is begin -- Need to check if the button is active or not as a -- deactivated button will also send this signal -- when it is toggled from an active state. if Get_Active (Object) = True then -- Do your stuff here :-) Setup.Examine_Method := Method; end if; end On_Method_Radio_Button_Toggle; But you don't have to use an Enumerated type you can use Integer, Chars, String etc... But there may be much better solutions to this which is more elegant, if somebody has one I would very much like to learn it too :-) > My problem is now that i want to start a spawn with the arguments > selected thru the buttons. Can you explain this a bit more? I'm not sure I understand the word spawn (English not my first language) >I think my problem has also to do > with Type Conversion... i looking now for a couple of days to solve this > and i also didn`t find somewhere else (mailing-list...) an answer. I hope > you can give me hints. You should join the GtkAda mailinglist if you haven't already. Preben -- () Join the worldwide campaign to protect fundamental human rights. '||} {||' http://www.amnesty.org/