[gedit-list] Re: Howto embed gedit in other app?



On Wed, Apr 30, 2003 at 06:36:06PM +0200, Paolo Maggi was heard to
remark:
> Hi,
>
> > I have another application that uses several text-entry boxes,
> > and I want to be able to pop-up gedit to edit the contents of those
> > fields.  The app is gnotime, a time-keeping/diary type thing,
> > at http://gttr.sourceforge.net, the fields in question are the
> > 'notes' and 'diary entry' fields.  Thus I want to pipe the text
> > to gedit (yes, thats currently possible), and then, whenever the
> > user hits the gedit save button, to have the contents piped back
> > to gnotime.
>
> You could create a temporary file and monitor it for changes (using
> gnome-vfs monitors).
> When the user hits the gedit save button, you will be notified by
> gnome-vfs.
> You can then read the file from disk and remove it.
> I know... this is not a great solution.

Well, I guess that could work; not ideal, but I suppose something is 
better than nothing ...

> > Whatever that stunt may be, I haven't yet quite figured it out.
> > If gedit really uses gnome-vfs, then should I write a gnome-vfs 
plugin
> > for gnotime, so that gnotime data looks like a filesystem?  Hmmm.
>
> Note that ATM gedit does not use gnome-vfs for saving files.
>
> >
> > Should I just copy most of the gedit source code into gnotime,
> > and perform some vicious hacks to make it work? Yuck....
> >
> > Is there some way to make oaf/bonobo do this for me?
>
> gedit exposes a simple CORBA interface, but I don't think it can help
> you in this case. You could try to modify it and send us a patch :-)

I would really like to have this feature, but given that its more than
a days worth fo work, it drops in priority ... but I suspect it may
become a big issue for me real soon...

Well, another question, and several remarks.

What would be the *best* way of doing this?  Modify gedit to use 
gnomeVFS?  Modify the CORBA interface?

I would hope that gnotime is not the only app that wants to embed 
a (mini-) word-processor/editor, surely others will want something
similar.   So what I was really hoping to find was some generic gnome
interface that lets a user to designate 'my favorite editor' (wether
its gedit or something else), and then allow a gnome app to pipe some
data to the user's 'favorite editor' and get the results back.  So
in some sense, the 'right answer' is not gedit-specific, but is a
gnome-desktop issue.   However, I'm not sure who to write to in the
gnome-desktop world to ask about this sort of thing.

--linas





-- 
pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas linas org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933




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