Re: Q: Can you cause the sceen to REDRAW itself
Posted in 1995
Using ungetc() won't work -- I4GL uses unbuffered I/O to read the terminal (a direct read(2) system call), not code from <stdio.h>. To refresh the screen, you need to call down onto the curses package refresh() function. It's undocumented, so it might change and I didn't say anything, but there is a function with prototype 'void _winredraw(void)' which refreshes the screen. You could use the following code to access it: extern void _winredraw(void); int i4gl_refresh(int n) { if (n != 0) fgl_fatal("C function i4gl_refresh()", __LINE__, -1318); _winredraw(); return(0); } In use, you'd say: CALL i4gl_refresh() I've not actually tested this, but I've checked for one major possible cause of trouble, in that if the screen is not supposed to have changed, then using the curses refresh() function does nothing. To forcibly redraw the screen would be harder, requiring a data element in the stdscr structure to be set correctly. I originally noted a different function; however, _winredraw() forcibly redraws all the I4GL windows onto stdscr and then sets the relevant data member and then calls the other function -- this should work. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: Paul J Harrison <paul@roan.co.uk> >Date: Tue, 3 Oct 1995 13:32:14 GMT >X-Informix-List-Id: <news.17565> > >On 27 Sep 1995, Ancil Bethelmy for development wrote: >> I would like to know if there is a way to make a screen that has garbage left >> over from opening and closing forms automatically redraw itself without the >> user typing "^R" to redraw. > >I'm no C programmer and I'm new to Informix, but I wonder if this can be >done by using C's ungetc() function?? > >I tried playing around with this idea when trying to get some control >over the "input array" statement. (ie: put a paging keystroke out onto >"stdin", and then read it, to make it automatically page etc.) >But I couldn't get it to work, Informix just ignores it, or I was doing >something wrong. > >Is there anything in this ? ... or am I on a wild goose chase ? >Any thoughts you wonderful C programming type people ? > >(Informix Ver 4-SE) > >|| Paul J Harrison || || >|| paul@roan.co.uk || Locomotive Driver - "Is this a hold-up?" || >||Roan Technology Ltd|| Emmet Brown - "It's a science experiment!" || >|| Wokingham U.K. || ||