Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The heart is not a logical organ. -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4


devel / comp.lang.ada / Re: GtkAda and timeout

SubjectAuthor
* GtkAda and timeoutAdaMagica
`* Re: GtkAda and timeoutDmitry A. Kazakov
 `* Re: GtkAda and timeoutAdaMagica
  `- Re: GtkAda and timeoutDmitry A. Kazakov

1
GtkAda and timeout

<b58495a7-5134-4b51-962f-d197d4cdaa2dn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5929&group=comp.lang.ada#5929

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:1190:: with SMTP id d16mr4379131qtj.391.1631791117491;
Thu, 16 Sep 2021 04:18:37 -0700 (PDT)
X-Received: by 2002:a25:7e46:: with SMTP id z67mr6132905ybc.166.1631791117356;
Thu, 16 Sep 2021 04:18:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 16 Sep 2021 04:18:37 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b58495a7-5134-4b51-962f-d197d4cdaa2dn@googlegroups.com>
Subject: GtkAda and timeout
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Thu, 16 Sep 2021 11:18:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: AdaMagica - Thu, 16 Sep 2021 11:18 UTC

Example: a ticket automaton

When a ticket is selected (button press), the user has to insert coins (button press). If no coins are inserted within a certain time, the ticket selection is aborted.

Thus, I need a timeout that starts each time a button is pressed.

I'm struggling with the GtkAda RM and UG - no help. Also testgtk is no real help.

Christoph

Re: GtkAda and timeout

<shvfet$hl1$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5930&group=comp.lang.ada#5930

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and timeout
Date: Thu, 16 Sep 2021 15:05:33 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shvfet$hl1$1@gioia.aioe.org>
References: <b58495a7-5134-4b51-962f-d197d4cdaa2dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="18081"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Thu, 16 Sep 2021 13:05 UTC

On 2021-09-16 13:18, AdaMagica wrote:
> Example: a ticket automaton
>
> When a ticket is selected (button press), the user has to insert coins (button press). If no coins are inserted within a certain time, the ticket selection is aborted.
>
> Thus, I need a timeout that starts each time a button is pressed.
>
> I'm struggling with the GtkAda RM and UG - no help. Also testgtk is no real help.

GTK is synchronous, there is no timeouts. You have two options:

1. An Ada task using a delay statement and then triggering GTK action.
2. A timer queued to the GTK loop.

Note that GTK is not multitasking, if you choose #1 you will need to
marshal actions to the GTK loop (the task running it). See the GtkAda
contributions how to use tasks with GTK.

For the option #2 see GLib.Main, the function Timeout_Add and generic
package Generic_Sources queue a timer. When timer triggers you do your
stuff and then remove the timer.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: GtkAda and timeout

<a7b21594-91bb-4137-b3ea-f9f14fe62cb8n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5931&group=comp.lang.ada#5931

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:58d0:: with SMTP id u16mr6363099qta.189.1631815651659;
Thu, 16 Sep 2021 11:07:31 -0700 (PDT)
X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr8304014ybu.91.1631815651471;
Thu, 16 Sep 2021 11:07:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 16 Sep 2021 11:07:31 -0700 (PDT)
In-Reply-To: <shvfet$hl1$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <b58495a7-5134-4b51-962f-d197d4cdaa2dn@googlegroups.com> <shvfet$hl1$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a7b21594-91bb-4137-b3ea-f9f14fe62cb8n@googlegroups.com>
Subject: Re: GtkAda and timeout
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Thu, 16 Sep 2021 18:07:31 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: AdaMagica - Thu, 16 Sep 2021 18:07 UTC

Dmitry A. Kazakov schrieb am Donnerstag, 16. September 2021 um 15:05:36 UTC+2:
> 2. A timer queued to the GTK loop.
> For the option #2 see GLib.Main, the function Timeout_Add and generic
> package Generic_Sources queue a timer. When timer triggers you do your
> stuff and then remove the timer.

It's this second option I'm trying. Doing slight progress...

Re: GtkAda and timeout

<si01on$1ud0$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5932&group=comp.lang.ada#5932

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and timeout
Date: Thu, 16 Sep 2021 20:17:59 +0200
Organization: Aioe.org NNTP Server
Message-ID: <si01on$1ud0$1@gioia.aioe.org>
References: <b58495a7-5134-4b51-962f-d197d4cdaa2dn@googlegroups.com>
<shvfet$hl1$1@gioia.aioe.org>
<a7b21594-91bb-4137-b3ea-f9f14fe62cb8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="63904"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Thu, 16 Sep 2021 18:17 UTC

On 2021-09-16 20:07, AdaMagica wrote:
> Dmitry A. Kazakov schrieb am Donnerstag, 16. September 2021 um 15:05:36 UTC+2:
>> 2. A timer queued to the GTK loop.
>> For the option #2 see GLib.Main, the function Timeout_Add and generic
>> package Generic_Sources queue a timer. When timer triggers you do your
>> stuff and then remove the timer.
>
> It's this second option I'm trying. Doing slight progress...

#1 is actually based on #2. It installs is a timer that periodically
checks if an Ada task requested some GTK action.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor