Re: Using drag and drop to set where data should be saved

Jim Lesurf <[email protected]>
Newsgroups gmane.comp.desktop.rox.user
Message-ID <[email protected]>
In article <[email protected]>, Stephen
Watson <[email protected]> wrote:
> Jim Lesurf <[email protected]> wrote:

[snip lots]
> > 
> > Another is that I've played with the python example at
> > http://roscidus.com/desktop/Tutorials/Saving
> > 
> > and it works quite nicely for A and B above. So I'm hoping that there
> > is a simple way to extract the full pathname of the file created by
> > the drag-and-drop and then pass that on to launching the main code. Is
> > there not a method for reading this name from the class of object for
> > 'box'.
> etc?

> As I recall, the ROX-Lib version expects the call back to create the
> target file before returning and throws an exception if it doesn't. 
> You'll need to catch that if you're deferring file creation to a
> different process.

What I've been hoping is that there would be a method that lets me extract
the full-path filename used by SaveBox. The idea being that the python
could create a 'placeholder' file with some brief contents. But I would
then know the destination file the user wants, so the following program
would overwrite that with what was actually desired as output. i.e. after
the python part does its 'save' and the file appears the python rox loop
quits by passing on a system command in the command environment for the
compiled item, telling it the destination file name. (Hope that explanation
makes sense!)

However I've experimented with the SaveBox example and it looks like it
runs straight though the python into the mainloop before you even get to
drag and drop the icon! Once it goes into mainloop I have no idea (at
present) how you would then recover the filename.

Did this experiment by using an AppRun that opens a terminal and then runs
the SaveBox example in the terminal. I then put some print statements into
the python and these all print to the terminal window *before* I actually
drag and drop the icon offerred by the SaveBox.

So I am now wondering if what I want is simply impossible using the ROX-Lib
SaveBox.

My problem here is that I still know very little about python. I understand
the various simple examples that tend to appear at the start of basic
tutorials, etc. But have no real understanding of the ROX-Lib. Given that
it aims to make user working RO-like I'd expect the save box method for
file output is the preferred GUI. So I'd assumed what I wanted would be
simple. But...

If someone can explain if what I wish is possible (and how!) with ROX-Lib
I'd be grateful. Similarly, if it can be explained that what I had in mind
is simply impossible that would be useful as it means I can abandon the
idea!  :-)

Failing that, I'll revert to a mix of slowly learning a bit more about
python and leave my own simple ROX apps with the fairly crude methods I use
at present. I guess that if at some future point I gain the necessary
understanding I can return to this and improve the file saving process to
be more drag-and-drop friendly.  :-)

BTW I have nothing against the idea that a program will tend to produce
info for saving *before* the save. So I can see that the python example as
it stands makes sense for many cases. But some of my programs tend to have
to generate large output files. Biggest so far is 2.7GB. That's unusual,
but many are in the range up to about 800MB. Given this, I'm reluctant to
go down the route of trying to generate this all in RAM first just so I can
use the existing SaveBox example as my method. Could make life awkward. :-)

Thanks,

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


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.