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, ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
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 <yuriy.tymchuk@me.com> wrote:
Hi Mark,
sadly, Iâm not confident about this, but maybe you should use Athens
Uko
On 16 Jan 2014, at 10:52, ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
look at Canvas class On 16 January 2014 10:52, ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
-- Best regards, Igor Stasenko.
On 16 Jan 2014, at 10:52 , ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
Thanks for help. I'll try out your suggestions. Mark 16 ÑÑÑ. 2014 12:50, коÑиÑÑÑÐ²Ð°Ñ "Henrik Johansen" < henrik.s.johansen@veloxit.no> напиÑав:
On 16 Jan 2014, at 10:52 , ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
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 ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com>
Thanks for help. I'll try out your suggestions. Mark 16 ÑÑÑ. 2014 12:50, коÑиÑÑÑÐ²Ð°Ñ "Henrik Johansen" < henrik.s.johansen@veloxit.no> напиÑав:
On 16 Jan 2014, at 10:52 , ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
On 16 January 2014 14:00, ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> wrote:
Problem is solved) Looked at Canvas class and used it, as some of you adviced.
it was me, me :)
As for me it was the best choice for such a simple task. Thank you again.
now you owe me a pony
2014/1/16 ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com>
Thanks for help. I'll try out your suggestions. Mark 16 ÑÑÑ. 2014 12:50, коÑиÑÑÑÐ²Ð°Ñ "Henrik Johansen" < henrik.s.johansen@veloxit.no> напиÑав:
On 16 Jan 2014, at 10:52 , ÐаÑкÑÑн Ð ÑзÑн <mrizun@gmail.com> 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
-- Best regards, Igor Stasenko.
participants (5)
-
Esteban Lorenzano -
Henrik Johansen -
Igor Stasenko -
Yuriy Tymchuk -
ÐаÑкÑÑн Ð ÑзÑн