Command equivalent to left-click
Jim Lesurf <jcgl <at> audiomisc.co.uk>
2010-01-02 12:38:50 GMT
I'm currently writing a simple ROX app which is to act as a 'demo' for some
people. The task is to be able to search a set of metadata I have and
identify which items meet the search keywords, etc. I have a system that
works moderately well, but has some snags which I'm sure can be overcome,
but I'm too ignorant as yet to solve!
The app works on the simple basis of starting an xterm and running the
program there so it can ask the user to type in the required keywords, and
then report its progress. However the main output is in the form of an HTML
file the user then can read and use. This lists detailes of 'found' items,
says which CDROM of the set they are on, and gives a URL that will let the
browser load them once the appropriate CDROM is mounted.
This works. But the process shows one irritating feature. This is because I
have (currently) to load the file into a browser by using the C system()
proceedure to issue something like 'firefox <filename>'. This has two
snags.
Firstly it means it has to name the browser, so I then have to have a user
changable setting for the command if they are using some other browser.
Secondly, the browser process is a child of the main application xterm
process. This means that if I close the xterminal window it abruptly also
shuts the browser down. It also means that if I use evince to view the PDF
files that are on the CDROM, firefox lets me do this OK, but any errors due
to the way I've had to tweak evince *not* to open absurdly large windows
then pop up in the xterm window!
If I click on the HTML file in a filer window then, of course, none of the
above occurs. Presumably because the browser process is then a child of the
windowing system. Alas, that means the user has to do this instead of
having the application get the browser to display the result.
So is there a simple command that will ensure the browser view of the
resulting file does *not* vanish if the xterminal window is closed, and
does *not* pass unwanted moans by evince back up to it?
With RO I'd use Filer_Run and that would solve the problem. But I'm trying
to get a version that lets me supply people with a ROX version - and
ideally one that also works for non ROX linux users who can start the
process by clicking AppRun.
FWIW I've tried using exec and adding &. Using & allows me to stop the
moans by evince from being passed to the xterminal, but doesn't allow the
browser to keep running if the xterm is closed. So clearly my ignorance is
holding me up. I'm assuming there is a Linux command equivalent to
Filer_Run that then use MIME, etc, to determine the action, but that I am
clueless as to what it is. This must be possible, surely?...
Slainte,
Jim
--
--
Electronics http://www.st-and.ac.uk/~www_pa/Scots_Guide/intro/electron.htm
Armstrong Audio http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc http://www.audiomisc.co.uk/index.html
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev