Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by andrew abernathy
Sat, 05 Sep 1992 04:09
the big demo / matrices
Author: andrew abernathy
Date: Sat, 05 Sep 1992 04:09
Date: Sat, 05 Sep 1992 04:09
43 lines
3141 bytes
3141 bytes
I have a (hopefully) quick question about matrices, cells and tags. I use browsers in several places to allow the user to select some entity. When I load the matrices, I set the cells tags to unique values so that I can easily identify a selected cell. Well, I can get the cell that is being selected, but it's tag always returns as -1. I'm having to identify cell by their stringValues, which is very inconvenient. Does anyone have any ideas why I might be getting the behavious I am? -- As a quick update to those familiar with my plight... the prototype is going pretty well. I have the majority of the general structure of my program together. (Things are not being done nearly as neatly as I would like... I plan to clean it up when the rush is over. Actually, sleep will come first...) Much is being handled by external programs. I am using Speaker/Listener to have ImageViewer open TIFF images and to have Adobe Illustrator open converted AutoCAD files. (I'm pre-loading the Illustrator files for performance reasons; can't do that with ImageViewer as it's not smart enough to know when it already has a file open. Fortunately, the load time on the TIFFS is acceptable.) I'm using distributed "I can't believe they're that trivial to implement" objects to control Movie. (That is just so amazingly cool! NeXT, you outdid yourself this time. Now I hope everyone starts setting up server objects and supplying the header files for them.) GETTING the video has turned out to be more of a problem than I expected... the images we grab on the pc don't look that great, but that's all we've got to grab them on. I've created a boatload of screens; probably 3/4 of the screens are done. I've stolen icons from all over the system. I haven't done any database stuff at a programmatic level (though the interface level works great); I may not have time to learn how to do that, in which case all my data will be dummied up. I've learned a good bit... enough to motivate me to keep going after the demo! The demo, by the way, is next Wednesday, but I have to have this wrapped up early Tuesday morning. I will be posting to let everyone know how it went. I am at an additional disadvantage in that this stuff will be in amongst a bunch of actual products on other platforms. My stuff already looks cooler than any of the other stuff. That could be largely due to the way cool icons I snarfed... I appreciate everyone's help; I will be acknowledging all messages when I get a opportunity to breathe. For now, back to work. -- andrew_abernathy@wire.gwinnett.com (NeXTmail gleefully accepted)
Re: the big demo / matrices
Author: Brian Willoughby
Date: Mon, 14 Sep 1992 20:09
Date: Mon, 14 Sep 1992 20:09
63 lines
4400 bytes
4400 bytes
andrew abernathy writes | I have a (hopefully) quick question about matrices, cells and | tags. I use browsers in several places to allow the user to select some | entity. When I load the matrices, I set the cells tags to unique values | so that I can easily identify a selected cell. Well, I can get the cell | that is being selected, but it's tag always returns as -1. I'm having to | identify cell by their stringValues, which is very inconvenient. Does | anyone have any ideas why I might be getting the behavious I am? | -- | andrew_abernathy@wire.gwinnett.com (NeXTmail gleefully accepted) I am very familiar with this NXBrowser problem and I know exactly what the cause is (although I don't know why NeXT designed it this way). If you look closely at the NeXTstep References for the AppKit classes, you'll see that NXBrowserCell is a subclass of Cell. If you read the -tag and -setTag: methods for the Cell class, you'll note that they are not implemented for some reason. Instead, they are designed to be overridden and implemented in subclasses of Cell. If NeXT had written NXBrowserCell as a subclass of ActionCell instead of Cell, then your code would work as you wrote it. The solution, which I have working under System 2.2a, is to subclass both NXBrowserCell and NXBrowser. You can't make a category of NXBrowserCell since you need to add an instance variable to hold the tag. So, in your subclass of NXBrowserCell, just add an instance variable named "tag" and write the (obvious) code for the -tag and -setTag: methods. You should also override the -initTextCell: method and initialize this instance variable to something predictable like -1. I skipped the implementation of -read: and -write: since I never archive my browsers (other programmers may need to fill in these last two methods as well). You also need to write a subclass of NXBrowser because I have found no other reliable method of setting the cell class and cell prototype (i.e. one that doesn't eventually cause the program to crash). You must call -setCellClass with the name of your NXBrowserCell subclass within the +initialize method for your NXBrowser subclass. #mount _soap_box This is a prime example of how NeXTanswers is nearly useless. appkit.827 says to -setCellClass inside -initFrame:, appkit.816 says to -setCellClass in -appDidInit:, appkit.761 says that you must -setCellClass in +initialize because -init is too late, implying that -appDidInit would be far too late. It took a great deal of experimentation and searching to figure out what worked. Of course the simpler approaches didn't work and they were what I tried first. #dismount _soap_box Within my main program, I call -setCellPrototype before using the browser. This can probably be done in -appDidInit, but since I have several .nib files I use the -setBrowserOutlet initialization method for the nib owner to accomplish this (where browserOutlet would be the name of my instance variable). My only remaining problem is determining whether I should worry about -free'ing the cell prototype when I free the nib instance. I could assume that NXBrowser will free its cell prototype within its own -free method since the program crashes when I -free the cell prototype myself. If anyone reads this far and can offer a hint, I would appreciate it. MallocDebug finds so many other memory leaks that I can't tell whether NXBrowser is freeing the prototype cell. Sorry I didn't post source code, but this stuff is not packaged as an example. It is hidden deep within a program that I am currently writing. -- Brian Willoughby Software Design Engineer, BSEE NCSU BrianW@SoundS.WA.com Sound Signal Processing Software and Consulting NeXTmail welcome - NO EMAIL SOLICITATION without prior permission
DIstributed Objects Problem (HELP!)
Author: Darcy BROCKBANK
Date: Tue, 15 Sep 1992 00:06
Date: Tue, 15 Sep 1992 00:06
33 lines
1663 bytes
1663 bytes
My architecture is the following: Client app A Server app B Server B is running, client A gets a connection to B via distributed objects. B has registered a named object, and runs the connection via runFromAppkit. Client A calls [B addClient:self] which succeeds, and A is added to a List object of clients of B. Now B starts up a DPSTimedEntry, which generates events every 30 seconds that are supposed to be passed on to every object in B's client list. However, these messages never return, and the client app doesn't recieve them. Every now and then an "Unrecognized error" pops up in the console. When the client app terminates, about 1/3 of the messages that were being sent (about 3 minutes worth) suddenly are recieved (I suppose it occurs when the connection is freed by the Application Object). In any event, everything seems to run fine if the DPSTimedEntry isn't generating the events (that is, if the methods are called from appDidInit: or something...) So, is this me forgetting to do something, or what? Any help is appreciated! - darcy
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads