Hello,
*> As I understand, the PicClass instances run on a different site than
> the MainClass, correct? I also assume that both MainClass and PicClass
> instances are stationary objects, i.e. their methods are executed at
> the site where the instances were originally created. (Correct me if
> my assumptions are wrong.)*
Yes this is correct.
*> Can you find out where exactly the program fails? I think it is
> probably in the displaypic method, but I wonder if it is before or
> after the new image is created.*
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.
*> (Although for performance reasons, you should ideally create the
> stationary wrapper only once...)*
Can you explain this point further?
Thanks
2010/8/25 Wolfgang Meyer <[email protected]>
> Hi,
>
> > Mainly the MainClass' display method looks like this:
> > meth display(L)
> > {ForAll L proc{$ X}
> > {X displaypic(self.canvas)}
> > end
> > }
> >
> > while the displaypic method in the PicClass:
> > meth displaypic(Canvas)
> > Creation of a new image using QTk
> > Creating a tag using the parameter Canvas
> > end
>
> As I understand, the PicClass instances run on a different site than
> the MainClass, correct? I also assume that both MainClass and PicClass
> instances are stationary objects, i.e. their methods are executed at
> the site where the instances were originally created. (Correct me if
> my assumptions are wrong.)
>
> Can you find out where exactly the program fails? I think it is
> probably in the displaypic method, but I wonder if it is before or
> after the new image is created.
>
> I don't have experience with using QTk in a distributed program. But
> one possible problem is that QTk objects can (probably?) not
> automatically be used on a site B when they have been created on a
> site A. As a system module, QTk is a "sited" module and that indicates
> some limitations (see also this message:
> http://lists.gforge.info.ucl.ac.be/pipermail/mozart-users/2010/011503.html
> ).
> You could try to create a stationary version of canvas by wrapping it
> with MakeStat.like so:
>
> meth display(L)
> StatCanvas = {MakeStat self.canvas}
> in
> {ForAll L proc{$ X}
> {X displaypic(StatCanvas)}
> end
> }
>
> (Although for performance reasons, you should ideally create the
> stationary wrapper only once...)
>
> Or you redesign the display method completely:
>
> meth display(L)
> for X in L do
> Pic = {X createpic}
> in
> Creating a tag using the self.canvas
> end
> end
>
> But this is just an untested suggestion. I do not know at this point
> whether creating QTk pictures on a remote site actually works. Maybe
> it is necessary to create the pictures on the same site where they are
> later used with the canvas.
>
> > so I thought about using a ticket in order to make the MainClass's canvas
> accessible.
>
> I think using a ticket will not work here. Tickets are for granting
> access to values to remote sites, but you DO already have a reference
> to the canvas.
>
> Cheers,
> Wolfgang
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users