System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
+++++++++++++++++++++++++++
From: stepan@natinst.com (Stepan Riha)
Date: 10 Sep 92 21:20:27 GMT
Organization: National Instruments, Austin, TX
In article <1992Sep10.200136.18513@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent) writes:
[how to get more than 255 chars out of a dialog text item deleted]
>Now I have a question. When you make a new TERecord, it is 32k in size,
>right?
>
>If you have a modal dialog box with 4 text areas, that's automatically
>128k of RAM sucked up for 4x255 = 1020 bytes for actualy data (retrieved or
>set via the SetIText/GetIText calls. If you used the MacOS calls to
>the letter, that's a 1020/128k percent utilization... pretty awful.
>
>Hey, Apple! How about creating a new TextEdit interface so that we can
>specify the buffer size to use -- as large or small as we need?
>
>-Brent
When you make a new TERecord you only allocate memory for a TERec which is
initially a little over 100 bytes large. The actual text is stored in a handle
that grows according to how much text you have.
So if your (one-line) text contains 10 characters you'll use about 130 bytes
which is less than a Str255. If you actually have 255 characters in your
item, you'll need about 43% more memory than if items used Str255; with 10
characters you actually save about 50%.
Of course there is the overhead for two handles but that's quite negligible.
- --
Stepan Riha -- stepan@natinst.com
+++++++++++++++++++++++++++
From: bpb9204@tamsun.tamu.edu (Brent)
Date: 10 Sep 92 23:02:40 GMT
Organization: Texas A&M Univ., Inc.
bpb9204@tamsun.tamu.edu (Brent) writes:
|
|Now I have a question. When you make a new TERecord, it is 32k in size,
|right?
I apologize; my brain tries really hard sometimes to take a break.
I've used TextEdit stuff before and I don't know why I started thinking
like the above... No, the TERec is NOT 32k.
- -Brent
p.s. please don't email me any more replies to the above blunder.
---------------------------
From: korfhage@weston.poly.edu
Subject: Adding menus to existing applications (a la Thunder)
Date: 12 Sep 92 15:45:40 GMT
Organization: Polytechnic University, New York
We have a project consisting of a number of programs that interact with a HyperCard stack. All the programs in this project are supposed to have two menus (in addition to their normal menus) - one menu lists the other programs in the project and will launch them, and the other menu sends apple events to the hypercard stack or other programs. The apple event parameters will sometimes include the name of the front window.
We have source code for some of the programs, so they are no problem to modify. For other programs, like Excel, we can add macros and external functions to get it to do what we want. However, some programs are simply not customizable to the extent that we need. For these programs, it seems that we need to do something like the Thunder spelling checker, which adds its own menu to the menubar of specific applications.
The only problem is that I am not guru enough to know how to do this. Could anyone please help me with explanation and/or pointers to example code?
Thanks ever so much!
Willard
+++++++++++++++++++++++++++
From: haynes@mace.cc.purdue.edu (Carl W. Haynes III)
Date: 12 Sep 92 17:58:22 GMT
Organization: Purdue University
In article <1992Sep12.154540.15753@prism.poly.edu> korfhage@weston.poly.edu writes:
> [ asks how to add menus to existing applications ]
>
I wrote an INIT awhile ago which added a menu to SimAnt (SimAnt Cheater)
What I ended up doing was tail-patching _SetMenuBar and _MenuSelect.
On SetMenuBar, I would check to see if I was dealing with SimAnt and then
Create a new menu and insert it. The patch for _MenuSelect would simply
check to see if my menu was selected and respond accordingly.
I was only worried about making it work with this one application, I don't
know how generalizable this would be to others.
If you're only dealing with system 7, I'd suggest looking into how to
add icon menus, like the help and application menu, to all applications.
(I think they call them Finder Menus). I believe that this years
MacHack disk has a couple examples of how to do this. In fact I
believe Dylan Talk (available at the usual archives and the MacHack disk)