From owner-oi-users Mon Feb 20 05:35:14 1995 Return-Path: oi-users-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id FAA22189 for oi-users-outgoing; Mon, 20 Feb 1995 05:35:14 -0800 Received: from mxrelay.gmd.de (mxrelay.gmd.de [192.88.97.99]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id FAA22148 for ; Mon, 20 Feb 1995 05:35:04 -0800 Message-Id: <199502201335.FAA22148@freefall.cdrom.com> Received: from vm.gmd.de by mxrelay.gmd.de (SF for OpenVMS v1.0-alpha) with SMTP id 7B49ECDE ; Mon, 20 Feb 95 14:34:07 +0100 Received: from VM.GMD.DE by vm.gmd.de (IBM VM SMTP V2R2) with BSMTP id 8216; Mon, 20 Feb 95 14:29:53 +0100 Received: from VMPROFS.ESOC.ESA.DE (NJE origin MAILER@ESOC) by VM.GMD.DE (LMail V1.2a/1.8a) with BSMTP id 0637; Mon, 20 Feb 1995 14:29:54 +0100 Received: from ESOC (NJE origin PWILLIAM@ESOC) by VMPROFS.ESOC.ESA.DE (LMail V1.2a/1.8a) with BSMTP id 0047; Mon, 20 Feb 1995 14:32:06 +0100 Comments: Converted from PROFS to RFC822 format by PUMP V2.2X Date: Mon, 20 Feb 95 14:32:03 EWT From: Peter Williams Subject: Creating Application Windows in an OI_add_timeout callback To: Sender: oi-users-owner@FreeBSD.org Precedence: bulk Hello OI users, We are currently experiencing some strange behaviour when creating application windows for a OI_add_timeout callback. Maybe someone out there has come across the same problem and/or knows a solution. I have extracted out two small text cases which exhibit the problem. They appear at the end of this note. What I am expecting to happen in the first test case is for an application window to be created and displayed every 5 seconds. On a Sparc Station IPX this is pretty much what happens, but as more and more windows are created, the rate at which windows are created increases, ie the timeout is being ignored. Things get pretty manic on a Sparc Station 20, my screen is rapidly filled with windows as though the callback is being called with no timeout whatsoever. If rather than creating a new window in the callback, I add a new static text item, everything works as expected. This is shown in the second test case. (OI 4.0 under Solaris 2.3) --- TEST CASE ONE --- /* This application creates and displays an empty application window once the application has been idle for 5 seconds. This process of adding application windows should continue ad infinitum approximatly every 5 seconds. */ #include void timeoutCB(void *argp) { OI_app_window * wind = oi_create_app_window( "wind",1,1,"wind"); wind->set_associated_object(wind->root(),OI_def_loc,OI_def_loc,OI_active); } void main( int argc, char **argv ) { OI_init( &argc, argv, "OI Timeout Test" ); OI_add_timeout(5000,timeoutCB); OI_begin_interaction(); OI_fini(); } --- TEST CASE TWO --- /* This application creates and displays an empty application window. Once the application has been idle for 5 seconds, a static text item is created and added to the window. This process of adding text continues ad infinitum approximatly every 5 seconds. */ #include #include OI_app_window *wind; void timeoutCB(void *argp) { static int index = 0; OI_static_text *text = oi_create_static_text("text","fred"); text->layout_associated_object(wind,1,index++,OI_active); } void main( int argc, char **argv ) { OI_init( &argc, argv, "OI Timeout Test" ); wind = oi_create_app_window( "wind",1,1,"wind"); wind->set_associated_object(wind->root(),OI_def_loc,OI_def_loc, OI_active); wind->set_layout(OI_layout_row_aligned); OI_add_timeout(5000,timeoutCB); OI_begin_interaction(); OI_fini(); } End of Message