The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with Data Positioning from Columns in a flat file. oott1 Shell Programming and Scripting 3 06-14-2006 02:22 PM
Cursor Positioning bestbuyernc UNIX for Dummies Questions & Answers 1 09-06-2005 09:50 AM
Get the cursor position bestbuyernc Shell Programming and Scripting 0 07-27-2005 05:59 PM
Positioning curser at EOF in vi JimJim UNIX for Dummies Questions & Answers 6 12-08-2004 05:20 PM
Cursor positioning thru VI Editor Latha Nair UNIX for Dummies Questions & Answers 8 08-11-2004 08:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-02-2007
enuenu enuenu is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 39
positioning cursor

I am using curses.h and signals.h to control output to screen. My code displays an unchanging prompt that waits for user input. Meanwhile alarm signals are being generated that cause other ancillary messages to appear at other locations on the screen at various times.

The problem I have is with cursor control. Every time an alarm signal causes an ancillary message to be displayed, the cursor moves away from the main prompt to the ancillary message. I can control this by manually repositioning the cursor after every ancillary message is displayed, but this all interferes with the user trying to enter input at the main prompt. If an alarm signal arrives when the user is halfway through entering their input, the cursor moves to the ancillary message for an instant then back to the starting position at the main prompt, interfering with entering of their input. Any suggestions?
  #2 (permalink)  
Old 06-02-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Have a look here Multiplexing with curses.

You need to treat the signals as another stream of input.

A common technique I use is to create a pipe and include it as one of the input sources in a select(...) loop, in the signal handler I write a single byte to the pipe (usually the signum) and in the event loop I read the pipe.

This avoids all the messyness of missing signals or interrupt system calls. All the signals end up queued in the pipe ready to be read following the select.
  #3 (permalink)  
Old 06-02-2007
enuenu enuenu is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 39
Thanks. I will check it out.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0