Hello,
I am going through the "Tutorial" again.
I have modified it for double-clicking on one of its files to open the app and
display its contents.
This is what I have done:-
I have given the app an icon - App/Appearance/Icon
and I have given the File Types an icon too.
The appropriate masks have been added also.
In App MenuHandlers/FileOpen I have
If f <> Nil then //the user clicked Open
w=New TextWindow //create new instance of TextWindow
f.OpenStyledEditField w.TextField
w.Document=f //assign f to document property of TextWindow
w.title=f.Name //assign name of f to Title property of w
End if
In App/MacSerttings
MacCreator is RBTA
// In File Types,
Display Name is RBTE
Display Name is RBTE
Mac Type is TEXT
MacCreator is RBTA
Extension is .rbta
Double-Clicking on a document's icon will now open the app
// Once all that is done, then we'll be able to get this event via a Finder
drag and drop.
// We instantiate the main window implicitly,
Dim f as FolderItem
Dim w as TextWindow
w=New TextWindow //create new instance of TextWindow
'Double-Clicking on a document's icon will now open an empty document of our
app
'So far so good
// and pass the folder item to the same call that the main window uses when
we drag a file to it directly.
' And here is where the problem lies
f.OpenStyledEditField w.TextField
w.Document=f //assign f to document property of TextWindow
w.title=f.Name //assign name of f to Title property of w
An exception of class NilObjectException was not handled.
'The application must shut down.
Kindly assist.
Lennox.
---------------------------------
Yahoo! DSL Something to write home about. Just $16.99/mo. or less
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>