Thread: [F-Script-talk] not automatically introspecting, wtf?
Brought to you by:
pmougin
From: zuzu <sea...@gm...> - 2004-07-31 04:41:51
|
http://www.macdevcenter.com/lpt/a/1364 "When the browser opens, it displays a textual description of an object or list of objects. To do this, the browser asks objects for their description by sending the message printString. If you are familiar with F-Script, you will know that all objects respond to this message, whose default behavior is to call the standard NSObject method description. When you are browsing your workspace, the name of each variable is displayed to the left of the corresponding object description. Once you have identified the object to which you will send a message, you just need to select it by clicking on it." uh, no, no it doesn't. not for me on osx 10.2... instead the object browser merely displays "sys = <an instance of System>" i can use "select view" to click on gui objects to reveal NSButton or NSView... but that doesn't help me with NSObject, or getting a feel for the _mapping_ of the objects in an application. for example, i want to understand how TextEdit.app is composed... i've got it linked to F-Script with 'F-Script Anywhere'... supposidly it *should* display the instances of the objects loaded, their methods and values. but other than "select view", it doesn't. and even with "select view" i cannot simply edit the text of a value and manipulate the app in real-time. what am i doing wrong, with the intention of using the objective-c runtime to introspect running applications? TIA, -z |
From: zuzu <sea...@gm...> - 2004-07-31 05:43:05
|
http://www.macdevcenter.com/lpt/a/1364 "When the browser opens, it displays a textual description of an object or list of objects. To do this, the browser asks objects for their description by sending the message printString. If you are familiar with F-Script, you will know that all objects respond to this message, whose default behavior is to call the standard NSObject method description. When you are browsing your workspace, the name of each variable is displayed to the left of the corresponding object description. Once you have identified the object to which you will send a message, you just need to select it by clicking on it." uh, no, no it doesn't. not for me on osx 10.2... instead the object browser merely displays "sys = <an instance of System>" i can use "select view" to click on gui objects to reveal NSButton or NSView... but that doesn't help me with NSObject, or getting a feel for the _mapping_ of the objects in an application. for example, i want to understand how TextEdit.app is composed... i've got it linked to F-Script with 'F-Script Anywhere'... supposidly it *should* display the instances of the objects loaded, their methods and values. but other than "select view", it doesn't. and even with "select view" i cannot simply edit the text of a value and manipulate the app in real-time. what am i doing wrong, with the intention of using the objective-c runtime to introspect running applications? TIA, -z p.s. sorry if this is a repeat post; i haven't received a list copy back yet, so i may have sent it before receiving membership confirmation (thus rejected by the system at the time). |
From: Philippe M. <pm...@ac...> - 2004-07-31 21:07:50
|
The article you cited is a bit unclear on this point. The object browser does not automatically find all the object instances in the current application. It only displays either: - The object you provide to it if you open it using the browse: method defined on class System. Example: sys browse:'hello' - The objects that are defined in your F-Script workspace. Those are the objects that you (or some routine) have assigned to an F-Script variable (ex: the instruction "A := 6" assigns an NSNumber with a value of 6 to the variable A). Note that "sys" is a special variable that is automatically defined in your F-Script workspace. - The object that you select with the "Select view" button. - All the classes linked in the current application, when you use the "Classes" button From these objects, and by invoking the appropriate methods, you can often navigate to the objects that are of interest to you. Example: Clicking on the "Classes" button gives the list off all the classes in the application. Selecting the "NSUserDefault" class gives the list of class method for this class. Clicking on the "standardUserDefault" method invokes it and gives an NSUserDefault instance. Selecting it gives the list of its methods. Clicking on the "dictionaryRepresentation" method invokes it and returns a dictionary containing the current user default settings, etc... > and even with "select view" i cannot simply edit the text of a > value and manipulate the app in real-time. The browser lets you manipulate the app in real time by invoking methods on objects (by definition, objects are supposed to be manipulated like that: think encapsulation, abstract data type, etc...) Example: using the "select view" feature, select a button. The browser should display it (as well as some of its attributes). Select it in the object browser (click on the first row). The object browser should now display its methods. Now click on the "setTitle:" method, provide a string in the sheet that asks you for arguments (for instance type: 'hello' (with the simple cotes)), press return and look at your button on screen. Its title should now reads "hello". Best, Phil |