Re: loop gtk



Hi Grant

Let me explain more.

The idea is to have a text view, in this view an operator will be entering data commin from an 2D barcode scanner. The idea is to compara the introduced data as soon the operator has finished introducing it. I cannot figure how to do it, I tough to use a perl thread to monitor the current data, check the matrix lenght and compare the last scanned data to a reference.

But if you have a better idea I will thank you very much, I attach the code until now.



El mié, 14-08-2013 a las 11:55 +1200, Grant McLean escribió:
Hi Alejandro

It can be a challenge to integrate procedural concepts like loops with
an event-driven environment like Gtk.  In fact, your GUI code will
already be running in a loop - processing events as they occur.  So what
you need to do is integrate your loop with the event loop.

I'm not completely clear on your requirement, but another way of looking
at it might be as a work queue.

If you have all the "values" that you want to process in an array, then
you could have a key_press_event handler that checks for the Enter key,
uses 'shift' to take the next value from the array, does whatever is
required and then returns.  Next time the key_press_event occurs the
handler will run again and get the next value from the array.
Eventually the array will be empty and the handler will have no work
left to do (perhaps you will pop up a message to the user at that
point).

Hope that helps

Regards
Grant

On Tue, 2013-08-13 at 11:52 -0500, Alejandro wrote:
> Hello,
> 
> I want to create a loop, my explanation is:
> 
> Using a text view, I will introduce values, one by one, and after
> pressing enter, the loop should compare the introduced value with the
> reference, but, I do not figure how to stablish the loop.
> 
> May you help?
> 
> Alejandro 
> _______________________________________________
> gtk-perl-list mailing list
> gtk-perl-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtk-perl-list


_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-perl-list

Attachment: verificador_tarjetas_C489_02.pl
Description: Perl program



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]