acting on non event-oriented events 
Author Message
 acting on non event-oriented events

Hello,

This has been plagueing me for a while now. I'm trying to figure out how to
respond / act on things other than the normal events within the TK module.
For instance, if I'm in a "MainLoop;" and receive some stdin on an Entry, or
some info on a connected socket. Forking / Signals are one way, I'm sure..
but there have to be others. Please, one and all, point me in the right
direction.

- Adam



Tue, 09 Dec 2003 09:15:32 GMT  
 acting on non event-oriented events

Quote:

> This has been plagueing me for a while now. I'm trying to figure out how
> to respond / act on things other than the normal events within the TK
> module. For instance, if I'm in a "MainLoop;" and receive some stdin on an
> Entry, or some info on a connected socket. Forking / Signals are one way,
> I'm sure.. but there have to be others. Please, one and all, point me in
> the right direction.

Just some ideas:
Signals: You may set up some signal handler. Simply write code like:
            $SIG{USR1} = \&handle_signal_USR1;
            $SIG{INT}     = \&handle_signal_INT;
%SIG is a redeifned hash in perl.
Aren't there signals produced, when something happens on a socket?
Use non-blocking reads.

Waiting until something has been entered in an entry:
        $entry->waitVariable (\$variable)
where $variable is given as -textvariable =>.

Use a "polling routine" to check the state and execute "in the background":
        $widget->repeat ($milliseconds, \&polling);

I hope you found something new here :-)
Jrgen
--
Dr.rer.nat. Juergen Vollmer, Viktoriastrasse 15, D-76133 Karlsruhe

            www.informatik-vollmer.de Tel: +49(721) 9204871 Fax: +49(721)
24874



Tue, 09 Dec 2003 14:16:46 GMT  
 acting on non event-oriented events
Defenitely, thanks for the help. The polling appears to be what I was
looking for.



Quote:

> > This has been plagueing me for a while now. I'm trying to figure out how
> > to respond / act on things other than the normal events within the TK
> > module. For instance, if I'm in a "MainLoop;" and receive some stdin on
an
> > Entry, or some info on a connected socket. Forking / Signals are one
way,
> > I'm sure.. but there have to be others. Please, one and all, point me in
> > the right direction.

> Just some ideas:
> Signals: You may set up some signal handler. Simply write code like:
>             $SIG{USR1} = \&handle_signal_USR1;
>             $SIG{INT}     = \&handle_signal_INT;
> %SIG is a redeifned hash in perl.
> Aren't there signals produced, when something happens on a socket?
> Use non-blocking reads.

> Waiting until something has been entered in an entry:
>         $entry->waitVariable (\$variable)
> where $variable is given as -textvariable =>.

> Use a "polling routine" to check the state and execute "in the
background":
>         $widget->repeat ($milliseconds, \&polling);

> I hope you found something new here :-)
> Jrgen
> --
> Dr.rer.nat. Juergen Vollmer, Viktoriastrasse 15, D-76133 Karlsruhe

>             www.informatik-vollmer.de Tel: +49(721) 9204871 Fax: +49(721)
> 24874




Tue, 09 Dec 2003 16:11:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. POE 0.11: event driven state machines, also supports Perl/Tk and Event

2. HTML::Parser 3.07 text events vs token events

3. Processing other events while waiting for an event to happen

4. file events vs. window events

5. binding non-X events in listbox

6. Can't load 'C:/perl/site/lib/auto/Tk/Event/Event.dll' for module Tk::Event:

7. Again:Fileevent problem in Tk800.008 ? AND:How to put port events and user events together

8. Can't load 'C:/Perl/site/lib/auto/Tk/Event/Event.dll'

9. WIN32 Backing up event logs.

10. event log module

11. request: to show next event from flat db

12. Date/Event Tracking (SLA Reporting)

 

 
Powered by phpBB® Forum Software