es1@cunixb.cc.columbia.edu (Ethan Solomita) (10/28/90)
I was looking into how to write an AppIcon program that would create an icon on the workbench which, if an icon were dropped on it, the icon would be printed. It seems pretty simple. The only question I have is how to find the exact path of the file, as well as the name of the icon. The WBArg received contains a name and a lock. The name doesn't seem to have a path in it. I am not familiar with locks, and I assume that that is where to find the answer. Also, directories don't have a name, just an empty string. Is the lock usable anyway? I realize you don't print a directory but it is useful for other applications. Thanks, -- Ethan Ethan Solomita: es1@cunixb.cc.columbia.edu GorbachevAwards++; free (SovietUnion); IndependentRepublics += 15;
new@ee.udel.edu (Darren New) (10/30/90)
In article <1990Oct28.002631.27874@cunixf.cc.columbia.edu> es1@cunixb.cc.columbia.edu (Ethan Solomita) writes: >The only question I have is how to find the exact path of the >file, as well as the name of the icon. The WBArg received ^^^^^^^^^^^^^^^^ Which icon? >contains a name and a lock. Well, the name you got is "relative" to the lock. That is, if the lock is the current directory, then the name will open the file. If you Examine() the lock, the name field will contain the name of the directory holding the file. Use ParentDir() to get the lock on the parent of the directory holding the directory and Examine() that lock for its file name. And so on until you get an error or a zero lock or something like that (I forget which) at which point the name will be the name of the volume as seen on the workbench. For example, if the file's full path was XYZ:PdQ/AbC/Big/Cube Then you would get a lock on XYZ:PdQ/AbC/Big and the string "Cube". Examining the lock would yield "Big" in the name. Examining the ParentDir of the lock would yield "AbC" and so on all the way up to yielding "XYZ". The ParentDir() of "XYZ" probably yields zero, if I remember right. Also remember to put a colon in the right place instead of a slash. I don't know how .info files work under 2.0, so I can't help you there. -- Darren -- --- Darren New --- Grad Student --- CIS --- Univ. of Delaware --- ----- Network Protocols, Graphics, Programming Languages, Formal Description Techniques (esp. Estelle), Coffee -----