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,a04e500922557815,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 02:42:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!mango.news.easynet.net!easynet-melon!easynet.net!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Need advice: Enumerate or not Date: Wed, 15 May 2002 09:42:15 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1021455735 13877 129.241.83.78 (15 May 2002 09:42:15 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 15 May 2002 09:42:15 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:24080 Date: 2002-05-15T09:42:15+00:00 List-Id: Hi I'm developing a GtkAda application. I have a window and in this window I need to put an object depending on when the user wants. That is if he wants to add words then I remove the object that is there and add the object that deals with adding words, if he wants to be questioned then I have to put another object etc... What I'm wondering is that I now see that I need to call an update procedure for the object that is currently in the window if the user has done some changes in the preferences. The objects are all derived from an object in Gtkada called Gtk_Frame, but they are in different packages and the update procedure will also be in these seperate packages. So I was thinking either I can do some dispatching thing or I can use Enumerates like this: with Listing; with Examine; with Setup; procedure Update (Which_Object : Object_Enum_Type) is begin case Which_Object is when Add => Listing.Update; when Examine => Examine.Update; when Setup => Setup.Update; when others => null; end case; end Update; or with Listing; use Listing; with Examine; use Examine; with Setup; use Setup; -- I would have to use use here which I don't like procedure Update (Object : access Gtk_Frame_Record) is -- ^^^^^^^^^^^^^^^^^^^^^^^ -- Perhaps I need to write sth else here, I'm -- not sure as I haven't tested it yet. begin Update (Object); end Change_Mode; Which would be the more sensible way to go? Thanks for any hints in advance. Preben