QTk troubles with Mozart 2 : failure when moving a widget inside a canvas.

76 views
Skip to first unread message

sascha.van...@gmail.com

unread,
Nov 4, 2013, 11:17:08 AM11/4/13
to mozart-...@googlegroups.com
Dear all,

the subject explains everything. Could someone please solve the problem ?

Below is a piece of code that reproduces the problem (I am running on MacOS 10.9, 10.8 had the same problem if I remember correctly). In the code, you can see I tried delete too, that works fine. However, when I try to use a Tag and to add all widgets in the canvas, I also get an error. Maybe it is related I don't know.

Many thanks !

Sascha



declare
[QTk]={Module.link ["x-oz://system/wp/QTk.ozf"]}

local
   Canvas
   RHandle
   Desc=td(canvas(bg:black
          width:100
          height:100
          handle:Canvas))
   Window={QTk.build Desc}
   Tag
in
   %Tag={Canvas newTag($)}
   {Window show}
   {Canvas create(rectangle 0 0 10 10 fill:white handle:RHandle)}
   %{Tag addtag(all)}
   {Delay 3000}
   %{RHandle delete}
   {RHandle move(10 10)}
   %{Canvas create(rectangle 10 10 20 20 fill:white)}
end

Jérémie Melchior

unread,
Nov 13, 2013, 4:07:44 AM11/13/13
to mozart-...@googlegroups.com
Dear all,
 
The problem comes from this statement: (https://github.com/mozart/mozart2-stdlib/blob/master/wp/qtk/QTkDevel.oz#L532) which means this piece of code:
 if {Tk.returnInt 'catch'(v("{") b([Obj Msg]) v("}"))}==1 then
            {Exception.raiseError qtk(execFailed Obj {VS2Tk Msg})}
         end
I don't know enough of Tk to understand what is wrong with the Tk.returnInt call.
With the CreateRectangle action it returns something else than 1 so that's ok.
Obj is a reference to an Object and Msg is create(1:rectangle ...)
With the Move action:
Tk.returnInt returns 1 and then throws the exception. Obj is also a reference to an Object. Msg is now b([move <Object> d(move(-1 0))]).
This does not look good to me as this is the format that encapsulates the message.
 
can someone help me with the meaning of the statement and of the language?
best regards,
 
Jérémie
Reply all
Reply to author
Forward
0 new messages