Question about dragging an image into the vm in Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about dragging an image into the vm in Windows

Mariano Martinez Peck
 
Hi folks. It has been asked  a problem in Pharo mailing list and I wanted to ask you. The summary is this:

- You are allowed to take a .image and drag it into a vm (.exe) and this will run the VM with the dragged image

- In such case, the image is interpreted as systemAttribute 1

The problem is when you define a image in the ini file. Suppose I add this to my ini file:

ImageFile=Contents\Resources\Pharo-1.0.image

Then, if I try to drag and drop another image to the VM, there will be an UTF8 input error as the thing that I dragged (the image) is interpreted as systemAttribute 2 and thus, in the method startUpAfterLogin it seems systemAttribute 2 is the sources file. So, it tries to load such file as if it were a text file, but as it is an image file...then the error.

The ideal would be: if I have defined a image in the file, to be allowed to drag another one. Of course, the one I drag should be used and set as systemAttribute 1.

Do you know how can I do that? is this fixable ?

In other hand, maybe I can do a validation and a nice error message in case the above cannot be done.

Thanks

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

Andreas.Raab
 
On 4/30/2010 5:11 AM, Mariano Martinez Peck wrote:
> The ideal would be: if I have defined a image in the file, to be allowed
> to drag another one. Of course, the one I drag should be used and set as
> systemAttribute 1.
>
> Do you know how can I do that? is this fixable ?

I don't understand what you're asking for. The current handling makes it
so that if you're in a deployment setting with the ImageFile attribute
set, then the VM will pass the argument to the image where it's been
processed. This is so that one can support file type associations where
users can simply double click documents to open them (drag and drop
functions the same way).

> In other hand, maybe I can do a validation and a nice error message in
> case the above cannot be done.

The error is in the iamge. You can do whatever validation is necessary.

Cheers,
   - Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

Mariano Martinez Peck
 


On Fri, Apr 30, 2010 at 6:04 PM, Andreas Raab <[hidden email]> wrote:
On 4/30/2010 5:11 AM, Mariano Martinez Peck wrote:
The ideal would be: if I have defined a image in the file, to be allowed
to drag another one. Of course, the one I drag should be used and set as
systemAttribute 1.

Do you know how can I do that? is this fixable ?

I don't understand what you're asking for. The current handling makes it so that if you're in a deployment setting with the ImageFile attribute set, then the VM will pass the argument to the image where it's been processed. This is so that one can support file type associations where users can simply double click documents to open them (drag and drop functions the same way).


What I am saying is the following: if you define an image in the .ini file and then try to drag and drop another image to the .exe (the vm) then an error is raised in the image (the one that is defined in the ini file). I wish that instead of loading the image of the ini file and raise an error, that it loads the image I dragged and dropped. The same as if there were any image defined in the .ini file.

I am not being clear ?

Thanks.

Mariano

Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

Andreas.Raab
 
On 4/30/2010 2:58 PM, Mariano Martinez Peck wrote:

> On Fri, Apr 30, 2010 at 6:04 PM, Andreas Raab <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On 4/30/2010 5:11 AM, Mariano Martinez Peck wrote:
>
>         The ideal would be: if I have defined a image in the file, to be
>         allowed
>         to drag another one. Of course, the one I drag should be used
>         and set as
>         systemAttribute 1.
>
>         Do you know how can I do that? is this fixable ?
>
>
>     I don't understand what you're asking for. The current handling
>     makes it so that if you're in a deployment setting with the
>     ImageFile attribute set, then the VM will pass the argument to the
>     image where it's been processed. This is so that one can support
>     file type associations where users can simply double click documents
>     to open them (drag and drop functions the same way).
>
>
> What I am saying is the following: if you define an image in the .ini
> file and then try to drag and drop another image to the .exe (the vm)
> then an error is raised in the image (the one that is defined in the ini
> file). I wish that instead of loading the image of the ini file and
> raise an error, that it loads the image I dragged and dropped. The same
> as if there were any image defined in the .ini file.

I see what you're saying. It's an interesting idea but currently not
supported. Like I was saying the ImageFile feature is provided for
deployment scenarios not for development, i.e., the idea is to pretend
there's "just" the executable which in every respect behaves like an
application.

If you wanted to implement your idea I would suggest to create a new
entry instead of ImageFile, perhaps named DefaultImage. It's meaning
would be to "launch the specified image if no image is specified". This
way one can decide whether to use a "strictly sealed" application or a
more developer-oriented usage like you're asking for.

Cheers,
   - Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

Bert Freudenberg
 
On 01.05.2010, at 00:27, Andreas Raab <[hidden email]> wrote:

> If you wanted to implement your idea I would suggest to create a new  
> entry instead of ImageFile, perhaps named DefaultImage. It's meaning  
> would be to "launch the specified image if no image is specified".  
> This way one can decide whether to use a "strictly sealed"  
> application or a more developer-oriented usage like you're asking for.
>
> Cheers,
>  - Andreas

The Mac VM works like that. Maybe that's where the confusion comes from?

That reminds me: John, it would be nice if the default image name was  
expanded like the other paths, relative to the resources folder. Then  
I could put the image into a subfolder, and not next to all the plugin  
bundles.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

stephane ducasse-2

I think that the problem is that in some schools they install the oneclick and they students drop their image on it.

Stef

On May 1, 2010, at 2:24 AM, Bert Freudenberg wrote:

> On 01.05.2010, at 00:27, Andreas Raab <[hidden email]> wrote:
>
>> If you wanted to implement your idea I would suggest to create a new entry instead of ImageFile, perhaps named DefaultImage. It's meaning would be to "launch the specified image if no image is specified". This way one can decide whether to use a "strictly sealed" application or a more developer-oriented usage like you're asking for.
>>
>> Cheers,
>> - Andreas
>
> The Mac VM works like that. Maybe that's where the confusion comes from?
>
> That reminds me: John, it would be nice if the default image name was expanded like the other paths, relative to the resources folder. Then I could put the image into a subfolder, and not next to all the plugin bundles.
>
> - Bert -
>

Reply | Threaded
Open this post in threaded view
|

Re: Question about dragging an image into the vm in Windows

Mariano Martinez Peck
 


On Sat, May 1, 2010 at 8:48 AM, stephane ducasse <[hidden email]> wrote:

I think that the problem is that in some schools they install the oneclick and they students drop their image on it.


Yes. At university, students installed the one click. They start to do the lesson, and then they did a "save as" to save it to another image. After that, "the obvious" way for them to run such image was to drag and drop it to the .exe file...which raised in an error.

Cheers

Mariano

 
Stef

On May 1, 2010, at 2:24 AM, Bert Freudenberg wrote:

> On 01.05.2010, at 00:27, Andreas Raab <[hidden email]> wrote:
>
>> If you wanted to implement your idea I would suggest to create a new entry instead of ImageFile, perhaps named DefaultImage. It's meaning would be to "launch the specified image if no image is specified". This way one can decide whether to use a "strictly sealed" application or a more developer-oriented usage like you're asking for.
>>
>> Cheers,
>> - Andreas
>
> The Mac VM works like that. Maybe that's where the confusion comes from?
>
> That reminds me: John, it would be nice if the default image name was expanded like the other paths, relative to the resources folder. Then I could put the image into a subfolder, and not next to all the plugin bundles.
>
> - Bert -
>