Greetings!
It is possible to convert created JS file to ST classes in Amber?
-- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
I don't understand :) Can you show us an example of what you want to do? Cheers, Nico On Apr 4, 2013, at 8:54 PM, XumuK <[hidden email]> wrote: Greetings! -- Nicolas Petton http://www.nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
For example i have some JavaScript code. And i want to edit it but in amber.
I know that Amber compile Smalltalk to JavaScript. Is it possible to port javascript code to smalltalk and create package? For example i have somelib.js and want i want to see it in left panel in Amber IDE... Is it clear? )))
-- пятница, 5 апреля 2013 г., 2:34:16 UTC+4 пользователь nicolas petton написал:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
In reply to this post by XumuK
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?
четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал: Greetings! You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. main.js (5K) Download Attachment |
I am currently working and learning the canvas element myself. What is the difficulty? Getting the canvas element is the least documented thing you need to do.
After that, you follow those rules: https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back
2013/4/5 XumuK <[hidden email]> I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it? Sincerely yours, Apostolis Xekoukoulotakis You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..
пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал: -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Here is a function which I use to draw a line: on: aCanvasId start: aStartPoint end: anEndPoint |canvas ctx| canvas := ('#',aCanvasId) asJQuery at:0.
console log:canvas. ctx := canvas getContext: '2d'. ctx beginPath. ctx moveTo: (aStartPoint x) and: (aStartPoint y). ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke. 2013/4/5 XumuK <[hidden email]> I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning.. Sincerely yours, Apostolis Xekoukoulotakis You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
It is clear. Troubles are connected with such code:
var Renderer = function(canvas){ var that = { init:function(system){ ... }, redraw:function(){ .... } initMouseHandling:function(){ ..... } $(canvas).mousedown(handler.clicked); } return that; } пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Found more simple example:
var o = { test: 5, bla: true } How to interpret this? | obj | obj := (Object new) test: 5; bla: true. Doesn`t work... пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал: It is clear. Troubles are connected with such code: You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Solved. Sorry for my stupid questions...))
пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал: Found more simple example:-- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Not solved...
How can I write var a = { first: function(parameter){ } second: function() { } } in Amber? Please, help me to understand... пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал: Solved. Sorry for my stupid questions...))-- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
a := #{ 'first' -> [:parameter | ]. 'second' -> [] } On 9 April 2013 20:53, XumuK <[hidden email]> wrote: Not solved... You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way? 2013/4/9 Ryan Simmons <[hidden email]>
Sincerely yours, Apostolis Xekoukoulotakis You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
You are right, I assumed he just wanted to pass some data to another js library. Sorry On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction. the js line to create the renderer sys.renderer = Renderer("#viewport"). would be changed to sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface
On 9 April 2013 21:20, Ryan Simmons <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. Arbour.st (4K) Download Attachment |
Sorry to load in the code from the previous message load the st file into a Workspace, select all and then press "file in" On 9 April 2013 22:58, Ryan Simmons <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Thanks a lot!
It`s would be very helpfull in future for me! Sorry for taking your time
-- среда, 10 апреля 2013 г., 1:00:35 UTC+4 пользователь Ryan Simmons написал:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
In reply to this post by Ryan Simmons-2
Here it must be changed to ( sys asJQuery ) attr: 'renderer' set: ( (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface )
because of sys object don`t have a renderer field.
-- среда, 10 апреля 2013 г., 0:58:55 UTC+4 пользователь Ryan Simmons написал:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Also there is an error in mouseHandler class.
In function getMousePositionForEvent: event ...... mousePosition := arbor Point: (event pageX - pos left) y: (event pageY - pos top). mousePosition := NativeFunction constructor: 'arbor.Point' value: (event pageX - pos left) value: (event pageY - pos top). ...... среда, 10 апреля 2013 г., 15:01:09 UTC+4 пользователь XumuK написал: Here it must be changed to ( sys asJQuery ) attr: 'renderer' set: ( (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface ) You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Hello Xumuk, sorry for popping in late. From looking at the thread your main issue was to understand the JS code and how to transform it into an Amber equivalent structure, right?
Best, Manfred On Thu, Apr 11, 2013 at 8:50 AM, XumuK <[hidden email]> wrote: Also there is an error in mouseHandler class. You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Free forum by Nabble | Edit this page |