Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tcl/Tk with C - "select" function

Status
Not open for further replies.

yaronb

Programmer
Jan 6, 2001
13
IL
Hello,

I have a problem:

In my C program, I'm using the "select" function, that tells me if I got data on a certain socket or got data from stdin (using file descriptors set).
When ever I recieve an indication from the "select" function that the stdin in "on" (someone entered seomething), I read it from stdin.

If I'll use the Tcl/Tk GUI with a text widget, I'll loose the ability to know if the key was pressed (it's a chat program - so I have to get the string the user entered...)

How can I use the text widget so that whenever it receives an input, the Tcl/Tk GUI will notify the "select" function ?

I'm open to any suggestion..

Thank you.

Yaron
 
I'm writing a chat client... I don't think your program must do something to EVERY keystroke. But do an entry, and bind a proc to the ENTER key. Tcl/tk is event driven, so use events!

kgergely@turul.eet.bme.hu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top