discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GWorkspace openFile & ImageViewer


From: Enrico Sersale
Subject: Re: GWorkspace openFile & ImageViewer
Date: Wed, 9 Apr 2003 16:57:32 +0300 (EEST)

On Wed, 9 Apr 2003, Richard Frith-Macdonald wrote:

> Marko Riedel wrote:
>
> >thanks for those pointers but I have already done exactly what you
> >suggest:
> >
> >(a) implement -application:openFile:
> >(b) modify GPSTextInfo.plist
> >
> >No luck so far. I think Enrico's message documents the problem I'm
> >having.
> >
> >In particular, I was able to duplicate the "gopen" behavior that he
> >describes:
> >
> > > gopen a.rtf
> > >
> > > "a" is loaded and shown.
> > >
> > > gopen b.rtf
> > >
> > > "b" is not open.
> > >
> >
> >
> I'm not sure what app he's using there ...  Perhaps it's an app which
> doesn't implement application:openFile: ?

Beeing the file in the example a .rtf file, the application I've used is
Ink.
I've *not* used GWorkspace to open the files, but the gopen tool.
But I must say that the behaviour of the app (GWorkspace) and that of the
tool (gopen) is exactly the same: only the first file is open.
Moreover, gopen and GWorkspace use pratically the same code to open the
file, that is, NSWorkspace's -openFile:withApplication:.

But, the problem, can be better described with two exemples (in fact
there are *two* problems):

1) Ink
Ink doesn't implement application:openFile: because it is a document based
application.
Instead of application:openFile: it implements
-loadFileWrapperRepresentation:ofType: and -loadDataRepresentation:ofType.
In this case I'm sure that -loadFileWrapperRepresentation:ofType: is
called only for the first file. The second one is ignored.

2)Gorm
Gorm implements application:openFile: and the method is correctly called
for the first file when the app is also launched and for the second one,
too. But, in this case (the second file) no window appears.
Here I've all the libraries and the applications built with debug=yes, so,
adding some breakpoints in Gorm, I can see that -openFile:withApplication:
works correctly but, after [[doc window] makeKeyAndOrderFront: self];, no
window appears.

Other application as, for example, ToyViewer have the correct behaviour.

> Trying it with Gorm documents, it works fine on my machine ... A single
> instance of Gorm opens two documents.
>
> My suggestion is that you build the gui library and GWorkspace with
> debug=yes, then run GWorkspace under gdb and set breakpoints in the code
> to see what's going wrong.
>
> Also, you could send me a tar image of your current source and I can do
> that (I always build everything for debug, so it's easy for me).
> Of course, if it works on my system then we haven't got much closer to a
> solution.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]