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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.96.0.7.MISMATCH!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Properties Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4pnv7nl4cdui$.1n28i7lqk4mek$.dlg@40tude.net> <1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net> <1u5dftkqqi68c.10079qnqyyfwb$.dlg@40tude.net> Date: Wed, 1 Dec 2010 22:45:31 +0100 Message-ID: <15tv4yga36dpi$.1hc09dlbgcmqe.dlg@40tude.net> NNTP-Posting-Date: 01 Dec 2010 22:45:29 CET NNTP-Posting-Host: 49684c5d.newsspool2.arcor-online.net X-Trace: DXC=Z[P@aOSc?lB[6=1B@oB@@@A9EHlD;3YcB4Fo<]lROoRA8kFjWES]eFOH X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15736 Date: 2010-12-01T22:45:29+01:00 List-Id: On Wed, 1 Dec 2010 13:35:32 -0800 (PST), Maciej Sobczak wrote: > On Dec 1, 7:22�pm, "Dmitry A. Kazakov" > wrote: > >>> Perhaps the scope you have in mind is too large. Is it really >>> necessary to have the GUI operate outside of one task? >> >> Affirmative. Consider an oscilloscope widget indicating real-time data. >> Consider a debug window showing log messages from different tasks. > > And how is this any different from, say, printing exactly the same log > messages on standard output? It is just same. You can safely call Put_Line from any task. But if you do Set_Text in GTK, that will crash your program. > How do you solve this problem with Ada.Text_IO? Why the same solution > cannot apply to GUI? I would like to have a similar solution, i.e. GUI things working without switching the contexts. >>> Leave the task handling to the application designer. >> >> Obtrusive and inefficient. I did it for GtkAda. It is quite uncomfortable >> to use, and if you forget to route GTK requests to the main task, you get >> sporadic crashes difficult to trace down, quite nasty. > > I thought that Ada has enough tools to support arbitrary visibility > and access strategies. If you can "forget to route GTK requests to the > main task", then there is some package/typing problem in the code. Is > GUI to be blamed for this? On the context of the main GTK task you just call Set_Text. From an alien task you need to instantiate a generic, or pass a closure, or override a primitive operation of a query object and from the callback call to Set_Text. The router calls the callback on the context of the main task. You would not do this for each graphic operations. Instead you have a sort of transactions, sets of operations executed in a group. This makes the code look very different. As I said it is obtrusive. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de