Article View: comp.sys.next.programmer
Article #2327Custom IB Palette object mushed together from boxed control objects
From: Joseph Goldstone
Date: Mon, 11 Jan 1993 19:44
Date: Mon, 11 Jan 1993 19:44
44 lines
2995 bytes
2995 bytes
Probably the error here is in my conception of how IB works, but... I want to agglutinate several standard UI objects (four TextFields and a one-element Matrix of SliderCells) into a new UI object, and have that object on a palette. The Textfields serve to label the slider, indicate the slider's min and max values, and display the slider's current numeric value as text. Because I plan on using an awful lot of these (for a 3DKit camera settings interpolation program) I wanted to 1) for N labelled sliders have N outlets in my App's distributor object, not 5*N 2) have each labelled slider accept messages to set and get current values and to set and get the labelled slider's min and max values 3) put these thangs on a palette so that I could re-use them in other programs (I've wanted this functionality before) Straightforward enough to create a Palette project, and in the new Palette window align things as I liked and Group them into a Box object. But IB only lets you drag things into windows that happen to be subclasses of View (even though they can have extra baggage on their shoulders, witness the ProgressView in the Palettes tutorial being grouped within a box - the box gets dragged into any new App's window along with the ProgressView itself). But how to indicate that the group of objects comprising this box are part of the new class I'm defining? I can whip up a class definition pretty readily in Edit that contains id pointers to the five enclosed objects, and parse it; but only a dragged-in custom view will let you replace its type (or rather, specify with which type it will later be replaced) in IB's attributes inspector, so this newly-parsed class definition does me no good. I suppose I'd be happy if I could figure out how to reparent the controls that I'd grouped into the Box as subviews of my custom View, and to set the id pointers in the custom View's object to those controls. Sure, I could assemble the controls inside the object programmatically, but if this is the only way, then I'm appalled at IB. I can't believe that the distance from simple object to compound is as great as the distance between interactive construction of user interfaces from UI object palettes, and using Edit to create C code that manually instantiates UI objects. Can someone point out my more obvious conceptual problems here, so I can move on from thinking about sliders to thinking about shaders? :) -- joseph
Technical Details
Message-ID:
<1993Jan11.194430.6405@lilliput.fdn.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!arakis.fdn.org!gamb.fdn.org!lilliput!josephShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!arakis.fdn.org!gamb.fdn.org!lilliput!joseph From: joseph@lilliput.fdn.org (Joseph Goldstone) Subject: Custom IB Palette object mushed together from boxed control objects Message-ID: <1993Jan11.194430.6405@lilliput.fdn.org> Keywords: IB Palette control Sender: joseph@lilliput.fdn.org Organization: Lilliputian Pictures - Paris, France. Date: Mon, 11 Jan 1993 19:44:30 GMT Lines: 45