Hello!
Task is simple - draw a line on a form(actually this line will be a border of a cell). While browsing classes I found LineSegment and LineMorph. Which of them is better to use in my case? And another question: I know how to initialize both of them, but don't know how to draw it on my form.
Thank you for help. Mark |
Hi Mark,
sadly, I’m not confident about this, but maybe you should use Athens Uko On 16 Jan 2014, at 10:52, Маркіян Різун <[hidden email]> wrote: > Hello! > > Task is simple - draw a line on a form(actually this line will be a border of a cell). While browsing classes I found LineSegment and LineMorph. Which of them is better to use in my case? And another question: I know how to initialize both of them, but don't know how to draw it on my form. > > Thank you for help. > Mark |
In reply to this post by Mark Rizun
look at Canvas class On 16 January 2014 10:52, Маркіян Різун <[hidden email]> wrote:
-- Best regards, Igor Stasenko. |
In reply to this post by Uko2
hi,
I think you need LineMorph. AFAIK, LineSegment is just used to draw PolygonMorph (not sure about that) Esteban On 16 Jan 2014, at 11:00, Yuriy Tymchuk <[hidden email]> wrote: > Hi Mark, > > sadly, I’m not confident about this, but maybe you should use Athens > > Uko > > On 16 Jan 2014, at 10:52, Маркіян Різун <[hidden email]> wrote: > >> Hello! >> >> Task is simple - draw a line on a form(actually this line will be a border of a cell). While browsing classes I found LineSegment and LineMorph. Which of them is better to use in my case? And another question: I know how to initialize both of them, but don't know how to draw it on my form. >> >> Thank you for help. >> Mark > > |
In reply to this post by Mark Rizun
On 16 Jan 2014, at 10:52 , Маркіян Різун <[hidden email]> wrote: > Hello! > > Task is simple - draw a line on a form(actually this line will be a border of a cell). While browsing classes I found LineSegment and LineMorph. Which of them is better to use in my case? And another question: I know how to initialize both of them, but don't know how to draw it on my form. > > Thank you for help. > Mark myForm getCanvas line: pt1 to: pt2 width: w color: c You only need to use a LineMorph if the line is not supposed to be static, otherwise drawing it directly on the Form is just as easy. Unless what you actually want is to create something like a spreadsheet, in which case a CellMorph, with RectangleMorph (cell outline) / StringMorph (cell contents) as subcomponents would probably be a better solution. (And the spreadsheet itself a morph, with CellMorphs as subcomponents) Cheers, Henry signature.asc (859 bytes) Download Attachment |
Thanks for help. I'll try out your suggestions. 16 січ. 2014 12:50, користувач "Henrik Johansen" <[hidden email]> написав:
|
Problem is solved) Looked at Canvas class and used it, as some of you adviced. As for me it was the best choice for such a simple task. Thank you again. 2014/1/16 Маркіян Різун <[hidden email]>
|
On 16 January 2014 14:00, Маркіян Різун <[hidden email]> wrote:
it was me, me :)
now you owe me a pony
-- Best regards, Igor Stasenko. |
Free forum by Nabble | Edit this page |