home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WWTCLKit / WWButtonVar.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  17.3 KB  |  660 lines

  1.  
  2. #import "WWButtonVar.h"
  3. #import "WWButtonVarCell.h"
  4.  
  5. @implementation WWButtonVar
  6.  
  7. static id myStoredCellClass;
  8.  
  9.  
  10. + initialize 
  11.   [WWButtonVar setVersion:1]; 
  12.  
  13.   if (self == [WWButtonVar class])
  14.   {  myStoredCellClass = [WWButtonVarCell class];
  15.   }
  16.  
  17.   return self; 
  18. }
  19. //
  20. + setCellClass:classID
  21. {
  22.   myStoredCellClass = classID;
  23.   return self;
  24. }
  25. ////////////////////////////////////////////////////////
  26. - initFrame:(const NXRect *)frameRect icon:(const char *)aString tag:(int)anInt target:anObject action:(SEL)aSelector key:(unsigned short)charCode enabled:(BOOL)flag
  27. {
  28.   id  oldCell;
  29.    const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  30.  
  31.  
  32.   [super initFrame:frameRect icon:aString tag:anInt target:anObject action:aSelector key:charCode enabled:flag];
  33.   [self registerForDraggedTypes:dragTypes count:1];
  34.  
  35.   oldCell = [self setCell:[[WWButtonVarCell alloc] init]];
  36.   [oldCell free];
  37.   return self;
  38. }
  39. //
  40. - initFrame:(const NXRect *)frameRect title:(const char *)aString tag:(int)anInt target:anObject action:(SEL)aSelector key:(unsigned short)charCode enabled:(BOOL)flag
  41. {
  42.   id  oldCell;
  43.   const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  44.  
  45.  
  46.   [super initFrame:frameRect title:aString tag:anInt target:anObject action:aSelector key:charCode enabled:flag];
  47.   [self registerForDraggedTypes:dragTypes count:1];
  48.  
  49.   oldCell = [self setCell:[[myStoredCellClass alloc] init]];
  50.   [oldCell free];
  51.   return self;
  52. }
  53. //
  54. - init
  55. {
  56.   id  oldCell;
  57.   const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  58.  
  59.  
  60.   [super init];
  61.   [self registerForDraggedTypes:dragTypes count:1];
  62.  
  63.   oldCell = [self setCell:[[myStoredCellClass alloc] init]];
  64.   [oldCell free];
  65.   return self;
  66. }
  67.  
  68. - awake
  69. {
  70.    const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  71.  
  72.  
  73.    [super awake];
  74.    [self registerForDraggedTypes:dragTypes count:1];
  75.  
  76.    framed = NO;
  77.    cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  78.    
  79.    return self;
  80. }
  81.  
  82.  
  83. // need to be able to see the cell's tclVar...
  84. - setTclVar:(const char *)str { return [[self cell] setTclVar:str]; }
  85. - (const char *)tclVar { return [[self cell] tclVar]; }
  86.  
  87. // need to be able to see the cell's controlString...
  88. - setControlString:(const char *)str { return [[self cell] setControlString:str]; }
  89. - (const char *)controlString { return [[self cell] controlString]; }
  90.  
  91. // need to be able to see the cell's tclExpression...
  92. - setTclExpression:(const char *)str { return [[self cell] setTclExpression:str]; }
  93. - (const char *)tclExpression { return [[self cell] tclExpression]; }
  94.  
  95. // need to be able to see the cell's tclExpression...
  96. - setTclCommand:(const char *)str { return [[self cell] setTclCommand:str]; }
  97. - (const char *)tclCommand { return [[self cell] tclCommand]; }
  98.  
  99. - setInterp:newInterp {  return [[self cell] setInterp:newInterp]; }
  100. - evaluateSelf { return [[self cell] evaluateSelf]; }
  101.  
  102. - sendAction:(SEL)theAction to:theTarget
  103. {
  104.   if ([cell respondsTo:@selector(updateInterp)])
  105.   {  [cell updateInterp];
  106.   }
  107.  
  108.   return [super sendAction:theAction to:theTarget];
  109. }
  110.  
  111.  
  112.  
  113.  
  114. - initFrame:(const NXRect *)frameRect
  115. {
  116.    const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  117.  
  118.  
  119.    [super initFrame:frameRect];
  120.    [self registerForDraggedTypes:dragTypes count:1];
  121.  
  122.    tclVarNameSize = 32;
  123.    tclVarName = (char *)NXZoneCalloc([self zone], tclVarNameSize, sizeof(char));
  124.    tclVarValueSize = 32;
  125.    tclVarValue = (char *)NXZoneCalloc([self zone], tclVarValueSize, sizeof(char));
  126.    tclVarTypeSize = 32;
  127.    tclVarType = (char *)NXZoneCalloc([self zone], tclVarTypeSize, sizeof(char));
  128.    // <null pointer> is around 15 characters, so add (say) 40 bytes to cmdBuf...
  129.    cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  130.    framed = NO;
  131.    restrictDropToSameName = NO;
  132.    restrictDropToSameType = NO;
  133.    actAsSource = YES;
  134.    actAsSink = YES;
  135.    frameColor = NX_COLORBLACK;
  136.    frameWidth = 3.0;
  137.    nameSwitchView = nil;
  138.    valueSwitchView = nil;
  139.    typeSwitchView = nil;
  140.  
  141.    return self;
  142. }
  143.  
  144. - awake
  145. {
  146.    const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  147.  
  148.  
  149.    [super awake];
  150.    [self registerForDraggedTypes:dragTypes count:1];
  151.  
  152.    framed = NO;
  153.    cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  154.    
  155.    return self;
  156. }
  157.  
  158. - free
  159. {
  160.    const char *fileType[] = { "" };
  161.    Pasteboard *pboard = [Pasteboard newName:NXDragPboard];
  162.  
  163.  
  164.    [pboard declareTypes:fileType num:0 owner:nil];
  165.    [self unregisterDraggedTypes];
  166.    image = nil; // don't free the potentially shared image
  167.    if (tclVarName) { free(tclVarName); }
  168.    if (tclVarValue) { free(tclVarValue); }
  169.    if (tclVarType) { free(tclVarType); }
  170.    if (cmdBuf) { NXZoneFree([self zone], cmdBuf); }
  171.  
  172.    return [super free];
  173. }
  174.  
  175. - reinitializeStringsFromZone:(NXZone *)zone
  176. {
  177.   tclVarName = (char *)NXZoneCalloc(zone, tclVarNameSize, sizeof(char));
  178.   tclVarValue = (char *)NXZoneCalloc(zone, tclVarValueSize, sizeof(char));
  179.   tclVarType = (char *)NXZoneCalloc(zone, tclVarTypeSize, sizeof(char));
  180.   cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  181.   return self;
  182. }
  183.  
  184. - copyFromZone:(NXZone *)zone
  185. {
  186.   id newCopy = [super copyFromZone:zone];
  187.  
  188.   [newCopy reinitializeStringsFromZone:zone];
  189.   [newCopy setTclVarName:tclVarName];
  190.   [newCopy setTclVarValue:tclVarValue];
  191.   [newCopy setTclVarType:tclVarType];
  192.  
  193.   return newCopy;
  194. }
  195.  
  196. - drawSelf:(const NXRect *)rects :(int)num
  197. {
  198.   [super drawSelf:rects :num];
  199.   if (framed)
  200.   {  NXSetColor(frameColor);
  201.      NXFrameRectWithWidth(&bounds, (NXCoord)frameWidth);
  202.   }
  203.   return self;
  204. }
  205.  
  206. /*-------------------- methods to be the source of a dragging operation */
  207.  
  208. - mouseDown:(NXEvent *)theEvent
  209. {
  210.    NXPoint  zero = {0.0, 0.0};
  211.    id       thePboard;
  212.    const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  213.    static char *fooBarBaz = "fooBarBaz";
  214.  
  215.     
  216.    if (!image) { return self; }
  217.    if (!actAsSource) { return self; }
  218.  
  219.    // Prevent default window ordering (this is a new appkit feature)
  220.    [NXApp preventWindowOrdering];
  221.  
  222.    //get the Pboard
  223.    thePboard = [Pasteboard newName:NXDragPboard];
  224.    [thePboard declareTypes:dragTypes num:1 owner:nil];
  225.  
  226.    // we're not really going to use this info, we're just sticking something on the board...
  227.    [thePboard writeType:NXAsciiPboardType data:fooBarBaz length:(1 + strlen(fooBarBaz))];
  228.     
  229.    //start the drag
  230.    [self dragImage:image    // visible on screen during drag
  231.                 at:&zero    // offset the mouse point for the drag
  232.             offset:&zero    // offset the inital mouse pt
  233.              event:theEvent    // theEvent structure
  234.         pasteboard:thePboard    // a Pasteboard with data on it
  235.             source:self        // source object
  236.          slideBack:YES];    // if no destination animate back to source
  237.     
  238.     return self;
  239. }
  240.  
  241. - draggedImage:(NXImage *)image beganAt:(NXPoint *)screenPoint  { return self; }
  242.  
  243. - (NXDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag  { return (NX_DragOperationCopy | NX_DragOperationGeneric); }
  244.  
  245. - draggedImage:(NXImage *)image endedAt:(NXPoint *)screenPoint deposited:(BOOL)flag { return self; }
  246.  
  247. /*-------------------- methods to be the destination of a dragging operation */
  248.  
  249. - (NXDragOperation)draggingEntered:sender
  250. {
  251.    if (!actAsSink)
  252.    {  if (framed)
  253.       {  framed = NO;
  254.      [self display];
  255.       }
  256.       return NX_DragOperationNone;
  257.    }
  258.  
  259.    // check to make sure we are not the source and this operation is a copy
  260.    if (   ([sender draggingSourceOperationMask] & NX_DragOperationCopy) 
  261.        && ([sender draggingSource] != self)
  262.        && ([[sender draggingSource] respondsTo:@selector(tclVarValue)]))
  263.    {  
  264.       // if we're selective, need to check the var's name
  265.       // if it's not the same as ours, we're outta here
  266.       if (restrictDropToSameName)
  267.       {  if (tclVarName && [[sender draggingSource] tclVarName] && strcmp(tclVarName, [[sender draggingSource] tclVarName]))
  268.          {  if (framed)
  269.         {  framed = NO;
  270.            [self display];
  271.          }
  272.             return NX_DragOperationNone;
  273.      }
  274.       }
  275.       if (restrictDropToSameType)
  276.       {  if (tclVarType && [[sender draggingSource] tclVarType] && strcmp(tclVarType, [[sender draggingSource] tclVarType]))
  277.          {  if (framed)
  278.         {  framed = NO;
  279.            [self display];
  280.          }
  281.             return NX_DragOperationNone;
  282.      }
  283.       }
  284.       framed = YES;
  285.       [self display];
  286.       //return the type of operation we want to do, this will dictate
  287.       //the type of cursor will show up when accepting the drag
  288.       return NX_DragOperationCopy;
  289.    }
  290.    if (framed) 
  291.    {  framed = NO;
  292.       [self display];
  293.    }
  294.    return NX_DragOperationNone;
  295. }
  296.  
  297. - (NXDragOperation)draggingUpdated:sender
  298. {
  299.    if (!actAsSink)
  300.    {  if (framed)
  301.       {  framed = NO;
  302.      [self display];
  303.       }
  304.       return NX_DragOperationNone;
  305.    }
  306.  
  307.    // make sure that this is a copy operation, and that this instance
  308.    // of DragView is not the source
  309.    if (   ([sender draggingSourceOperationMask] & NX_DragOperationCopy) 
  310.        && ([sender draggingSource] != self)
  311.        && ([[sender draggingSource] respondsTo:@selector(tclVarValue)]))
  312.     { 
  313.       if (restrictDropToSameName)
  314.       {  if (tclVarName && [[sender draggingSource] tclVarName] && strcmp(tclVarName, [[sender draggingSource] tclVarName]))
  315.          {  if (framed)
  316.         {  framed = NO;
  317.            [self display];
  318.          }
  319.             return NX_DragOperationNone;
  320.      }
  321.       }
  322.       if (restrictDropToSameType)
  323.       {  if (tclVarType && [[sender draggingSource] tclVarType] && strcmp(tclVarType, [[sender draggingSource] tclVarType]))
  324.          {  if (framed)
  325.         {  framed = NO;
  326.            [self display];
  327.          }
  328.             return NX_DragOperationNone;
  329.      }
  330.       }
  331.       framed = YES;
  332.       [self display];
  333.       return NX_DragOperationCopy;
  334.    }
  335.    if (framed) 
  336.    {  framed = NO;
  337.       [self display];
  338.    }
  339.    return NX_DragOperationNone;
  340. }
  341.  
  342. - draggingExited:sender
  343. {
  344.    if (!actAsSink)
  345.    {  if (framed)
  346.       {  framed = NO;
  347.      [self display];
  348.       }
  349.       return NX_DragOperationNone;
  350.    }
  351.  
  352.    if (framed) 
  353.    {  framed = NO;
  354.       [self display];
  355.    }
  356.    return self;
  357. }
  358.  
  359. - (BOOL)prepareForDragOperation:sender  
  360. {  
  361.    if (!actAsSink)
  362.    {  if (framed)
  363.       {  framed = NO;
  364.      [self display];
  365.       }
  366.       return NO;
  367.    }
  368.    return YES; 
  369. }
  370.  
  371. static int notJustBlanks(const char *str)
  372. {
  373.   const char  *ptr;
  374.  
  375.  
  376.   ptr = str;
  377.   if (ptr)
  378.   {  while (*ptr && isspace(*ptr))
  379.      {  ptr++;
  380.      }
  381.      if (*ptr) // if we're not at the end and we stopped, it's not just blanks...
  382.      {  return 1;
  383.      }
  384.   }
  385.   return 0;
  386. }
  387.  
  388.  
  389. - (BOOL)performDragOperation:sender
  390. {
  391.    if (!actAsSink)
  392.    {  if (framed)
  393.       {  framed = NO;
  394.      [self display];
  395.       }
  396.       return NO;
  397.    }
  398.  
  399.    // make sure that what we are getting is from the same application
  400.    // and did not originate from this view.
  401.    if (   [sender isDraggingSourceLocal] 
  402.        && ([sender draggingSource] != self) 
  403.        && ([[sender draggingSource] respondsTo:@selector(tclVarValue)]))
  404.  
  405.    {  // should check to make sure the sender will respond appropriately...
  406.       if (restrictDropToSameName)
  407.       {  if (tclVarName && [[sender draggingSource] tclVarName] && strcmp(tclVarName, [[sender draggingSource] tclVarName]))
  408.          {  if (framed) 
  409.         {  framed = NO;
  410.            [self display];
  411.         }
  412.         return NO;
  413.      }
  414.       }
  415.       if (restrictDropToSameType)
  416.       {  if (tclVarType && [[sender draggingSource] tclVarType] && strcmp(tclVarType, [[sender draggingSource] tclVarType]))
  417.          {  if (framed) 
  418.             {  framed = NO;
  419.            [self display];
  420.         }
  421.         return NO;
  422.      }
  423.       }
  424.       [self setImage:nil];
  425.       [self setImage:[[sender draggingSource] image]];
  426.       [self setTclVarValue:[[sender draggingSource] tclVarValue]];
  427.       if (nameSwitchView)
  428.       {  [nameSwitchView showViewNamed:tclVarName];
  429.       }
  430.       if (typeSwitchView)
  431.       {  [typeSwitchView showViewNamed:tclVarType];
  432.       }
  433.       if (notJustBlanks(tclVarValue))
  434.       {  // cmdBuf is basically "set <tclVarName> <tclVarValue>"
  435.          if (valueSwitchView)
  436.          {  [valueSwitchView showViewNamed:tclVarValue];
  437.          }
  438.          sprintf(cmdBuf, "set %s %s", tclVarName, tclVarValue);
  439.          [interp globalEval:cmdBuf];
  440.       }
  441.       framed = NO;
  442.       [self display];
  443.    }
  444.    if (framed) 
  445.    {  framed = NO;
  446.       [self display];
  447.    }
  448.    return YES;
  449. }
  450.  
  451. - concludeDragOperation:sender {  return self; }
  452.  
  453. /*-------------------- methods to display, and other useful stuff */
  454.  
  455. - (BOOL)acceptsFirstMouse  {  return YES; }
  456.  
  457. - (BOOL)shouldDelayWindowOrderingForEvent:(NXEvent *)theEvent {  return YES; }
  458.  
  459. // set and get stuff
  460.  
  461. - setTclVarValue:(const char *)str 
  462.   int   cnt;
  463.  
  464.  
  465.   if (tclVarValueSize <= 0) 
  466.   {  tclVarValueSize = 32; 
  467.      tclVarValue = (char *)NXZoneCalloc([self zone], tclVarValueSize, sizeof(char));
  468.      cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  469.   }
  470.   cnt = strlen(str);
  471.   while (cnt >= tclVarValueSize)
  472.   {  tclVarValueSize *= 2;
  473.      tclVarValue = (char *)NXZoneRealloc([self zone], tclVarValue, tclVarValueSize);
  474.   }
  475.   cmdBuf = (char *)NXZoneRealloc([self zone], cmdBuf, (40 + tclVarNameSize + tclVarValueSize));
  476.   strcpy(tclVarValue, str); 
  477.   return self; 
  478. }
  479. //
  480. - (const char *)tclVarValue { return tclVarValue; }
  481.  
  482.  
  483. - setTclVarName:(const char *)str 
  484.   int   cnt;
  485.  
  486.  
  487.   if (tclVarNameSize <= 0) 
  488.   {  tclVarNameSize = 32; 
  489.      tclVarName = (char *)NXZoneCalloc([self zone], tclVarNameSize, sizeof(char));
  490.      cmdBuf = (char *)NXZoneCalloc([self zone], (40 + tclVarNameSize + tclVarValueSize), sizeof(char));
  491.   }
  492.   cnt = strlen(str);
  493.   while (cnt >= tclVarNameSize)
  494.   {  tclVarNameSize *= 2;
  495.      tclVarName = (char *)NXZoneRealloc([self zone], tclVarName, tclVarNameSize);
  496.   }
  497.   cmdBuf = (char *)NXZoneRealloc([self zone], cmdBuf, (40 + tclVarNameSize + tclVarValueSize));
  498.   strcpy(tclVarName, str); 
  499.   return self; 
  500. }
  501. //
  502. - (const char *)tclVarName { return tclVarName; }
  503.  
  504. - setTclVarType:(const char *)str 
  505.   int   cnt;
  506.  
  507.  
  508.   if (tclVarTypeSize <= 0) 
  509.   {  tclVarTypeSize = 32; 
  510.      tclVarType = (char *)NXZoneCalloc([self zone], tclVarTypeSize, sizeof(char));
  511.   }
  512.   cnt = strlen(str);
  513.   while (cnt >= tclVarTypeSize)
  514.   {  tclVarTypeSize *= 2;
  515.      tclVarType = (char *)NXZoneRealloc([self zone], tclVarType, tclVarTypeSize);
  516.   }
  517.   strcpy(tclVarType, str); 
  518.   return self; 
  519. }
  520. //
  521. - (const char *)tclVarType { return tclVarType; }
  522.  
  523.  
  524. - (BOOL)restrictDropToSameName { return restrictDropToSameName; }
  525. - setRestrictDropToSameName:(BOOL)flag {  restrictDropToSameName = flag; return self; }
  526.  
  527. - (BOOL)restrictDropToSameType { return restrictDropToSameType; }
  528. - setRestrictDropToSameType:(BOOL)flag {  restrictDropToSameType = flag; return self; }
  529.  
  530. - (BOOL)actAsSink { return actAsSink; }
  531. - setActAsSink:(BOOL)flag 
  532. {  if (actAsSink && !flag) // we're about to turn it off...
  533.    {  [self unregisterDraggedTypes];
  534.    }
  535.    if (!actAsSink && flag) // we're about to turn it on...
  536.    {  const char  *dragTypes[] = { NXAsciiPboardType, NULL};
  537.       [self registerForDraggedTypes:dragTypes count:1];
  538.    }
  539.    
  540.    actAsSink = flag; 
  541.    return self; 
  542. }
  543.  
  544. - (BOOL)actAsSource { return actAsSource; }
  545. - setActAsSource:(BOOL)flag {  actAsSource = flag; return self; }
  546.  
  547. // IB stuff
  548. - (const char *)getInspectorClassName 
  549. {  
  550.    NXEvent  *event = [NXApp currentEvent];
  551.  
  552.    if (event->flags & NX_ALTERNATEMASK)
  553.    {  return [super getInspectorClassName];
  554.    }
  555.    
  556.    return "WWImageVarViewIBInspector"; 
  557. }
  558.  
  559. - write:(NXTypedStream *)stream 
  560. {
  561.    [super write:stream];
  562.    NXWriteTypes(stream, "***cccfc", &tclVarName, &tclVarValue, &tclVarType, 
  563.         &restrictDropToSameName, &restrictDropToSameType, &actAsSource, &frameWidth, &actAsSink);
  564.    NXWriteColor(stream, frameColor);
  565.    return self;
  566. }
  567. //
  568. - read:(NXTypedStream *)stream 
  569. {
  570.    int version;
  571.  
  572.    [super read:stream];
  573.  
  574.    version = NXTypedStreamClassVersion(stream, "WWImageVarView");
  575.    if (version == 1)
  576.    {  NXReadTypes(stream, "***ccc", 
  577.           &tclVarName, &tclVarValue, &tclVarType, 
  578.           &restrictDropToSameName, &restrictDropToSameType, &actAsSource);
  579.       frameColor = NX_COLORBLACK;
  580.       if (tclVarName)
  581.       {  tclVarNameSize = strlen(tclVarName) + 1;
  582.       }
  583.       else
  584.       {  tclVarNameSize = 0;
  585.       }
  586.       if (tclVarValue)
  587.       {  tclVarValueSize = strlen(tclVarValue) + 1;
  588.       }
  589.       else
  590.       {  tclVarValueSize = 0;
  591.       }
  592.       if (tclVarType)
  593.       {  tclVarTypeSize = strlen(tclVarType) + 1;
  594.       }
  595.       else
  596.       {  tclVarTypeSize = 0;
  597.       }
  598.    }
  599.    if (version == 2)
  600.    {  NXReadTypes(stream, "***cccf", 
  601.           &tclVarName, &tclVarValue, &tclVarType, 
  602.           &restrictDropToSameName, &restrictDropToSameType, &actAsSource, &frameWidth);
  603.       frameColor = NXReadColor(stream);
  604.  
  605.       if (tclVarName)
  606.       {  tclVarNameSize = strlen(tclVarName) + 1;
  607.       }
  608.       else
  609.       {  tclVarNameSize = 0;
  610.       }
  611.       if (tclVarValue)
  612.       {  tclVarValueSize = strlen(tclVarValue) + 1;
  613.       }
  614.       else
  615.       {  tclVarValueSize = 0;
  616.       }
  617.       if (tclVarType)
  618.       {  tclVarTypeSize = strlen(tclVarType) + 1;
  619.       }
  620.       else
  621.       {  tclVarTypeSize = 0;
  622.       }
  623.    }
  624.    if (version == 3)
  625.    {  NXReadTypes(stream, "***cccfc", 
  626.           &tclVarName, &tclVarValue, &tclVarType, 
  627.           &restrictDropToSameName, &restrictDropToSameType, &actAsSource, &frameWidth, &actAsSink);
  628.       frameColor = NXReadColor(stream);
  629.  
  630.       if (tclVarName)
  631.       {  tclVarNameSize = strlen(tclVarName) + 1;
  632.       }
  633.       else
  634.       {  tclVarNameSize = 0;
  635.       }
  636.       if (tclVarValue)
  637.       {  tclVarValueSize = strlen(tclVarValue) + 1;
  638.       }
  639.       else
  640.       {  tclVarValueSize = 0;
  641.       }
  642.       if (tclVarType)
  643.       {  tclVarTypeSize = strlen(tclVarType) + 1;
  644.       }
  645.       else
  646.       {  tclVarTypeSize = 0;
  647.       }
  648.    }
  649.    return self;
  650. }
  651.  
  652.  
  653.  
  654.  
  655. @end
  656.