Expecttk doesn't register Tk's stub table 
Author Message
 Expecttk doesn't register Tk's stub table

Tk 8.3.1 Bug:  Generated by Scriptics' bug entry form at
        http://www.*-*-*.com/
Responses to this post are encouraged.
------

Submitted by:  Jan Nijtmans
OperatingSystem:  All Windows
Synopsis:  Expecttk doesn't register Tk's stub table

ReproducibleScript:
This is a follow-up for:
    http://www.*-*-*.com/
The fix I suggested there was rejected because Expect is the
extension responsible for the fix. However, it is impossible
for Expect to do the stub initialization (at least on Windows)
because the internal Stub table is not exported from the dll.

ObservedBehavior:
Run the expectk executable and then try "package require Img" (assuming Img is
installed). The result is the error-message saying that this version of Tk doesn't
support Stubs. In fact, Tk is just fine, only Expect refuses to call Tk_Init().
Therefore the Stub table is not initialized; that's what causes the error-message.

Patch:
*** generic/tkWindow.c.orig     Sat Mar 25 00:13:18 2000
--- generic/tkWindow.c  Mon May  1 22:30:07 2000
***************
*** 2695,2702 ****
  }

- extern TkStubs tkStubs;
-
  /*
   *----------------------------------------------------------------------
   *
--- 2947,2952 ----
*** generic/tkInt.h.orig        Wed Apr 19 03:06:51 2000
--- generic/tkInt.h     Mon May  1 22:30:05 2000
***************
*** 882,887 ****
--- 900,907 ----
  # define TCL_STORAGE_CLASS DLLEXPORT
  #endif

+ extern TCL_STORAGE_CLASS TkStubs tkStubs;
+
  /*
   * Internal procedures shared among Tk modules but not exported
   * to the outside world:

PatchFiles:
    tkWindow.c tkInt.h



Sun, 20 Oct 2002 03:00:00 GMT  
 Expecttk doesn't register Tk's stub table

Quote:

> Tk 8.3.1 Bug:  Generated by Scriptics' bug entry form at
>         http://www.scriptics.com/support/bugForm.html
> Responses to this post are encouraged.
> ------

> Submitted by:  Jan Nijtmans
> OperatingSystem:  All Windows
> Synopsis:  Expecttk doesn't register Tk's stub table

> ReproducibleScript:
> This is a follow-up for:
>     http://dev.scriptics.com/ticket/issue-view.tcl?msg_id=4029
> The fix I suggested there was rejected because Expect is the
> extension responsible for the fix. However, it is impossible
> for Expect to do the stub initialization (at least on Windows)
> because the internal Stub table is not exported from the dll.

So all this patch does is export the stub table from the DLL so that the
ExpectTk shell (which has to link to the Tk library anyway) can get a
pointer to it and then register the stub table on behalf of Tk.

One question I have is why does ExpectTk not call Tk_Init anyway ? Does
ExpectTk work differently to Tk + package require Expect ? If so what
are the advantages and are they sufficient to justify maintaining this
'hack' ?

I personally don't like exporting the stubs tables as it damages the
encapsulation that Stubs gives you.

- Show quoted text -

Quote:
> ObservedBehavior:
> Run the expectk executable and then try "package require Img" (assuming Img is
> installed). The result is the error-message saying that this version of Tk doesn't
> support Stubs. In fact, Tk is just fine, only Expect refuses to call Tk_Init().
> Therefore the Stub table is not initialized; that's what causes the error-message.

> Patch:
> *** generic/tkWindow.c.orig     Sat Mar 25 00:13:18 2000
> --- generic/tkWindow.c  Mon May  1 22:30:07 2000
> ***************
> *** 2695,2702 ****
>   }

> - extern TkStubs tkStubs;
> -
>   /*
>    *----------------------------------------------------------------------
>    *
> --- 2947,2952 ----
> *** generic/tkInt.h.orig        Wed Apr 19 03:06:51 2000
> --- generic/tkInt.h     Mon May  1 22:30:05 2000
> ***************
> *** 882,887 ****
> --- 900,907 ----
>   # define TCL_STORAGE_CLASS DLLEXPORT
>   #endif

> + extern TCL_STORAGE_CLASS TkStubs tkStubs;
> +
>   /*
>    * Internal procedures shared among Tk modules but not exported
>    * to the outside world:

> PatchFiles:
>     tkWindow.c tkInt.h



Mon, 21 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Expecttk doesn't register Tk's stub table

2. Expect_tk doesn't initialize Tk's stub table

3. More of Tk's internal functions exported through Stub table

4. XFillRectangle missing from Tk's stub table

5. Please export 'TkGetDefaultScreenName' in Stub table

6. expectk doesn't support stubs

7. LINUX - Source Code Control with Perforce doesn't register

8. tkdesk on fedora core 5 -- doesn't run, doesn't compile

9. BLT installs but doesn't work, and TkTable doesn't build

10. ODBC/MS Access Doesn't Find Tables

11. Table's edit position doesn't update on first iteration of shift register.

12. My model doesn't 'walk'

 

 
Powered by phpBB® Forum Software