Question about dragging an image into the vm in Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] 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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] 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


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] 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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project