Hi,

> I think it fails before the creation of the new image and here is the error
> message.
>
> %*************************** type error *************************
> %**
> %** Expected type: class
> %** At argument:   1
> %** In statement:  {Object.new <C: QTkImage> <N: Init>(type:photo
> url:'picb.gif'
> ) _<dist:pxy>}
> %**
> %** Call Stack:
> %** procedure 'NewImage' in file
> "f:/cygwin/home/Administrator/Mozart-1-3-2/moza
> rt-stdlib/wp/qtk/QTkImage.oz", line 233, column 3, PC = 14365100
> %** procedure 'PicClass,displaypic/fast' in file "./Pic.oz", line 44, column
> 6, PC = 13
> 441296
>
> (I don't understand why there is a type error nor how to correct it)
> and this is the line in question:
>  Img = {QTk.newImage photo(url:self.pic)} %self.pic is a feature containing
> the url of the picture.

I do not completely understand that error message, either. But I think
it might be because QTk is a sited module and can only be used on the
site where it was created.
However, using a locally linked version of QTk will NOT help either.
While creating the image would work, you could not use the image with
the canvas from the other site.
I did some experiments with QTk, and I came to the conclusion that it
is not meant to be used in a distributed way.

I recommend to redesign your application such that QTk is only used on
one site (on the machine where the GUI shall be visible).
For example something like this in MainClass:

meth display(L)
     {ForAll L proc{$ X}
              Data = {X getData($)}  %% get information necessary to
create image
              Creation of a new image using QTk and Data
              Creating a tag using the parameter Canvas
           end
     }

>> (Although for performance reasons, you should ideally create the
>> stationary wrapper only once...)
> Can you explain this point further?

This was about the example code I had given. What I meant was that in
real code, it is not a good idea to call "MakeStat" again and again,
but instead create a stationary wrapper once (e.g. in the constructor)
and reuse it.

Hope this helps,
 Wolfgang
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to