[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 12:37:24 +0300 (EEST) |
On Tue, 8 Apr 2003, Marko Riedel wrote:
> Hi folks,
>
> I am trying to get GPSText to open PS and PDF files when they are
> double-clicked in the workspace browser. This was suggested to me by
> Nicolas Roard.
>
> I found that GWorkspace launches the application correctly, but it
> repeats the file name among the command line arguments. My application
> parses these as well, so that it opens the file twice. (I could fix
> this by checking whether the file has already been opened, but I would
> prefer to understand what exactly is happening.) I have also noticed
> that GWorkspace tries to lauch a second copy of the application when I
> click on a second file, whereas it should message the process that is
> already running to open the file.
>
> I was curious to know whether my code was the problem, so I compiled
> and installed ImageViewer. It seems to have the same problem: open a
> TIFF file and the app launches, open a second file and GWorkspace does
> not message the process that is already running and tries to launch
> another copy of ImageViewer instead.
>
> Maybe someone can help me out here.
>
> Best regards,
No, GWorkspace doesn't launch anything.
It only gets the "right" application name for the file from NSWorkspace
(getInfoForFile:application:type:), does some icon animation if this is
choosed in the preferences and then calls the NSWorkspace method
-openFile:withApplication:
It is NSWorkspace that keeps in "_launched" an array of the apps it has
launched, not GWorkspace.
An other (related?) problem: some apps, I've tried with Gorm and Ink,
don't open a second file if a file is already open.
For example, try:
gopen a.rtf
"a" is loaded and shown.
gopen b.rtf
"b" is not open.
Adding a NSLog in -loadFileWrapperRepresentation:ofType: shows that, the
second time, this method is not called.
- GWorkspace openFile & ImageViewer, Marko Riedel, 2003/04/08
- Re: GWorkspace openFile & ImageViewer,
Enrico Sersale <=
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Marko Riedel, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Enrico Sersale, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Alexander Malmberg, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Enrico Sersale, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Alexander Malmberg, 2003/04/09