Citát Guilhem BONNEFILLE <[EMAIL PROTECTED]>: > On Mon, 13 Feb 2006 17:42:48 +0000 > Richard Frith-Macdonald <[EMAIL PROTECTED]> wrote: > > > My understanding of the term 'inspector' does not refer to an > > application, but rather to a panel within an application, which lets > > you look at some information and (usually) change it. Because the > > things being inspected vary wildly, the contents of an inspector > > generally vary a lot, and about the only thing co0mmon to all > > inspectors is that they reside in panels ... for which we have the > > NSPanel object. > > > > Maybe you could describe what you think a generic inspector should do? > > I'm a GNUStep beginner, I'm surely wrong. > > It seems that an inspector have a special design: a drop-down menu at > the top (replaced in nowadays GUI by tabs) and corresponding widgets > below a rule. > What I expect, is something that allow me to concentrate only in the > parts below the rule (just call these parts specific parts). > I imagine a GSInspector where I register, at the init time, all the > specific parts. > Next, when the user select an object, I only have to inform the > GSInspector about the object selected. The GSInspector does itself all > the job to select which specific parts whould be available now and which > should be hiden. Perhaps, something else should be precised at the > register time in order to allow such selection (a class or protocol). Or > perhaps the selection could be done via introspection. > > Is it insane idea?
I have few inspector related classes already implemented, they are: EKInspector - controller object implementing functionality of one inspector EKInspectorPanel - panel with pop-up button for switching inspectors EKFocus - focused object Usage: - create EKInspector subclasses - implement - (NSArray *)inspectorIdentifiers; in objects you are going to inspect - register EKInspector subclasses with proper identifiers - connect appropriate menu items to showInspector: action of NSApplication When you select an object, just do: [[EKFocus sharedFocus] setObject:selectedObject]; and everything else is handled automatically: inspector panel is notified, it asks for There is some older implementation here: http://stefan.agentfarms.net/Download/GNUstep/Trash/Cartotheque-20050319.tar.gz (see the EK* classes inside) The inspector mechanism would be much nicer and simpler when we had Key-Value-Observing implemented ... Anyway, enjoy what is already present. Stefan Urbanek (*) EK means Environment Kit -- http://stefan.agentfarms.net First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi _______________________________________________ Help-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gnustep
