File: OldVariableList.m

package info (click to toggle)
wcalc 2.3.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,444 kB
  • ctags: 926
  • sloc: ansic: 8,993; objc: 1,946; lex: 798; sh: 766; yacc: 623; makefile: 79
file content (54 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
//  VariableList.m
//  Wcalc
//
//  Created by Kyle Wheeler on Sun Jan 20 2002.
//  Copyright (c) 2001 Kyle Wheeler. All rights reserved.
//

#import "variables.h"
#import "VariableList.h"
#ifdef MEMWATCH
#include "memwatch.h"
#endif

@implementation NSTableDataSource

// needs to be REALLY fast
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
	extern int contents;
	printf("contents = %i\n",contents);
	return contents;
}

// needs to be fast
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn*) aTableColumn row:(int)rowIndex
{
	extern struct variable *them;
	struct variable *cursor = them;
	int i;

	for (i=1;i<rowIndex;++i) {
		cursor = cursor->next;
	}
	if ([[[aTableColumn headerCell] stringValue] isEqualToString:@"Value"]) {
		printf("Value = %s!\n",strchr(cursor->keyvalue,'=')+1);
		return [NSString stringWithUTF8String:(strchr(cursor->keyvalue,'=')+1)];
	} else {
		char *temp = strchr(cursor->keyvalue,'=');
		NSString *foo;
		*temp=0;
		printf("Variable! = %s\n",temp2);
		foo = [NSString stringWithUTF8String:cursor->keyvalue];
		*temp = '=';
		return foo;
	}
}

- (void)tableView:(NSTableView*)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn*)aTableColumn row:(int)rowIndex
{
	printf("setvalue\n");
}

@end