Skip to content
Tcl Source Code History Of Ticket 219163
Login

History Of Ticket 219163

Artifacts Associated With Ticket 219163

  1. Ticket change [0a07f38233] (rid 113745) by nobody on 2000-10-26 05:02:41:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 1525 RFE
      Version: 8.1b2
      SubmitDate: '1999-03-18'
      LastModified: '1999-11-16'
      Severity: MED
      Status: Assigned
      Submitter: pat
      ChangedBy: hobbs
      RelatedBugIDs: 2074
      OS: Other
      Machine: NA
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      
      Jan Nijtmans
      
      
      DesiredBehavior:
      
          Currently Tcl doesn't have a main loop like Tk does. This means
      
          that if a Tcl-only application needs to process events, the only
      
          way is to put an "vwait dummyvar" at the end of the script. This
      
          solution is not ideal, but in the pre-stub period there hardly
      
          was another way.
      
      
          Here is a simple implementation of a Tcl_MainLoop() function.
      
          Normally this is a no-op, but Stubs allow other extensions to
      
          register their own event loops. Tk would be the first candidate
      
          to do so. There is already a slot reserved in the stub table
      
          (188) for this functionality.
      
      
      Patch:
      
      *** generic/tcl.decls.origWed Mar 17 22:55:40 1999
      
      --- generic/tcl.declsWed Mar 17 22:55:45 1999
      
      ***************
      
      *** 655,666 ****
      
        declare 187 generic {
      
            int Tcl_LinkVar(Tcl_Interp *interp, char *varName, char *addr, int type)
      
        }
      
      ! 
      
      ! # This slot is reserved for use by the plus patch:
      
      ! #  declare 188 generic {
      
      ! #      Tcl_MainLoop
      
      ! #  }
      
      ! 
      
        declare 189 generic {
      
            Tcl_Channel Tcl_MakeFileChannel(ClientData handle, int mode)
      
        }
      
      --- 655,663 ----
      
        declare 187 generic {
      
            int Tcl_LinkVar(Tcl_Interp *interp, char *varName, char *addr, int type)
      
        }
      
      ! declare 188 generic {
      
      !     void Tcl_MainLoop(void)
      
      ! }
      
        declare 189 generic {
      
            Tcl_Channel Tcl_MakeFileChannel(ClientData handle, int mode)
      
        }
      
      *** generic/tclDecls.h.origWed Mar 17 22:55:40 1999
      
      --- generic/tclDecls.hWed Mar 17 22:55:45 1999
      
      ***************
      
      *** 588,594 ****
      
        /* 187 */
      
        EXTERN intTcl_LinkVar _ANSI_ARGS_((Tcl_Interp * interp, 
      
        char * varName, char * addr, int type));
      
      ! /* Slot 188 is reserved */
      
        /* 189 */
      
        EXTERN Tcl_ChannelTcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, 
      
        int mode));
      
      --- 588,595 ----
      
        /* 187 */
      
        EXTERN intTcl_LinkVar _ANSI_ARGS_((Tcl_Interp * interp, 
      
        char * varName, char * addr, int type));
      
      ! /* 188 */
      
      ! EXTERN voidTcl_MainLoop _ANSI_ARGS_((void));
      
        /* 189 */
      
        EXTERN Tcl_ChannelTcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, 
      
        int mode));
      
      ***************
      
      *** 1271,1277 ****
      
            int (*tcl_IsSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 185 */
      
            char * (*tcl_JoinPath) _ANSI_ARGS_((int argc, char ** argv, Tcl_DString * resultPtr)); /* 186 */
      
            int (*tcl_LinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, char * addr, int type)); /* 187 */
      
      !     void *reserved188;
      
            Tcl_Channel (*tcl_MakeFileChannel) _ANSI_ARGS_((ClientData handle, int mode)); /* 189 */
      
            int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 190 */
      
            Tcl_Channel (*tcl_MakeTcpClientChannel) _ANSI_ARGS_((ClientData tcpSocket)); /* 191 */
      
      --- 1272,1278 ----
      
            int (*tcl_IsSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 185 */
      
            char * (*tcl_JoinPath) _ANSI_ARGS_((int argc, char ** argv, Tcl_DString * resultPtr)); /* 186 */
      
            int (*tcl_LinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, char * addr, int type)); /* 187 */
      
      !     void (*tcl_MainLoop) _ANSI_ARGS_((void)); /* 188 */
      
            Tcl_Channel (*tcl_MakeFileChannel) _ANSI_ARGS_((ClientData handle, int mode)); /* 189 */
      
            int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 190 */
      
            Tcl_Channel (*tcl_MakeTcpClientChannel) _ANSI_ARGS_((ClientData tcpSocket)); /* 191 */
      
      ***************
      
      *** 2194,2200 ****
      
        #define Tcl_LinkVar(interp, varName, addr, type) \
      
        (tclStubsPtr->tcl_LinkVar)(interp, varName, addr, type) /* 187 */
      
        #endif
      
      ! /* Slot 188 is reserved */
      
        #ifndef Tcl_MakeFileChannel
      
        #define Tcl_MakeFileChannel(handle, mode) \
      
        (tclStubsPtr->tcl_MakeFileChannel)(handle, mode) /* 189 */
      
      --- 2195,2204 ----
      
        #define Tcl_LinkVar(interp, varName, addr, type) \
      
        (tclStubsPtr->tcl_LinkVar)(interp, varName, addr, type) /* 187 */
      
        #endif
      
      ! #ifndef Tcl_MainLoop
      
      ! #define Tcl_MainLoop() \
      
      ! (tclStubsPtr->tcl_MainLoop)() /* 188 */
      
      ! #endif
      
        #ifndef Tcl_MakeFileChannel
      
        #define Tcl_MakeFileChannel(handle, mode) \
      
        (tclStubsPtr->tcl_MakeFileChannel)(handle, mode) /* 189 */
      
      *** generic/tclMain.c.origWed Mar 17 22:55:40 1999
      
      --- generic/tclMain.cWed Mar 17 22:56:42 1999
      
      ***************
      
      *** 18,23 ****
      
      --- 18,25 ----
      
        # undef TCL_STORAGE_CLASS
      
        # define TCL_STORAGE_CLASS DLLEXPORT
      
      
      + extern TclStubs tclStubs;
      
      + 
      
        /*
      
         * The following code ensures that tclLink.c is linked whenever
      
         * Tcl is linked.  Without this code there's no reference to the
      
      ***************
      
      *** 267,275 ****
      
      --- 269,306 ----
      
             */
      
      
            done:
      
      +     if (exitCode == 0) {
      
      + Tcl_MainLoop();
      
      +     }
      
            if (commandPtr != NULL) {
      
        Tcl_DecrRefCount(commandPtr);
      
            }
      
            sprintf(buffer, "exit %d", exitCode);
      
            Tcl_Eval(interp, buffer);
      
      + }
      
      + 
      
      + 
      
      + /*
      
      +  *---------------------------------------------------------------
      
      +  *
      
      +  * Tcl_MainLoop --
      
      +  *
      
      +  *Do nothing, unless a package replaced the main loop function.
      
      +  *
      
      +  * Results:
      
      +  *None.
      
      +  *
      
      +  * Side effects:
      
      +  *Arbitrary; depends on handlers for events.
      
      +  *
      
      +  *---------------------------------------------------------------
      
      +  */
      
      + 
      
      + void
      
      + Tcl_MainLoop()
      
      + {
      
      +     if (tclStubs.tcl_MainLoop != Tcl_MainLoop) {
      
      + tclStubs.tcl_MainLoop();
      
      + tclStubs.tcl_MainLoop = Tcl_MainLoop;
      
      +     }
      
        }
      
      
      PatchFiles:
      
          tcl.decls tclDecls.h tclMain.c
      
      
      
      
      The first half of this is in 8.2, but not the C func. 
      -- 08/20/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.1b2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "Event loop hook for Tcl"
    11. type initialized to: "RFE"
  2. Ticket change [228dc18d26] (rid 130768) by hobbs on 2000-11-17 07:12:05:

    1. closedate changed to: "2000-11-17T00:12:05"
    2. closer changed to: "hobbs"
    3. foundin changed to: "obsolete: 8.4a2"
    4. icomment:
      This was handled in 8.4a2 with the new Tcl_SetMainLoop function (implemented with a mix of this, JCW's metakit work, and blended together).  Tk does take advantage of this as well with 8.4a2.
      
      
    5. login: "hobbs"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "hobbs"
  3. Ticket change [465e0f93a1] (rid 99504) by dgp on 2001-04-20 02:55:20:

    1. foundin changed to: "None"
    2. status changed to: "Open"
    3. subsystem changed to: "None"
  4. Ticket change [322c4bd9d1] (rid 93563) by dgp on 2001-04-20 02:55:56:

    1. closedate changed to: "2001-04-19T19:55:56"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"
    4. subsystem changed to: "50. Embedding Support"