ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Dec/follow-up-to-instantiated-sub-class

This is follow-up-to-instantiated-sub-class in view mode; [Up]


Date: Sun 23-Dec-1989 22:51:23 From: dennisg@kgw2.uucp.WEC.COM (Dennis Glatting) Subject: follow-up to instantiated sub class first i would like to thank all of you who sent me mail on my subclassing an instantiated window problem. i think the problem needs a little more explination. first i have a instantiated window with controls and such. i assigned it a subclass of window, say NodeWindowTemplate, in IB. this template is stored in a file and loaded at run-time when a "super duper" class of operations are to take place. at that point i want to make several different subclasses of the NodeWindowTemplate as appropriate to selected controls. For example a EditNodeClass, ViewNodeClass, and others. all of these subclasses have different characteristics. i didn't want to create a template window in IB then paste it for each subclass. since my code has a tendency to change i didn't want to change a name of a control in one window and forget to change it in another. those errors are a real b..ch. (and they make you feel stupid too.) so. i though it would be cute to create a template window in IB then when the subclasses were created they would magically appear with NodeWindowTemplate's controls and functions along with their own special brand (some added other controls). i thought the easy thing to do was to archive the template then unarchive it by the subclass. i felt it was the philosophical thing to do. to make one template, dup it, hack it, then run it at run time rather then IB (for the reasons stated previously). (duping an object is easy as three lines of code.) well, as i was driving home yesterday, i felt i was just being a weenie and should write the code for NodeWindowTemplate. it wasn't really bad to write the code but sizing forms and button matricies inside of boxes in boxes wasn't my idea of a good time. i still have one teeny weeny problem. i got this matrix of buttons inside a box inside a box. i get the box's content view size, calculate the matrix's intercell spacing, then adjust the matrix (don't try this with disimilar form cells). i've traced though the code and the calculations are perfect (patting myself on the back) but the two button matrix displayed in the inner box is too high and the bottom radio button icon has a straight edge below it (think of a switch drawn then replaced by the circle with all but the bottom edge of the switch erased).

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.