Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

need help on chex scheme graphics
I would appreciate any help on what to put in the following code to
place points, lines, ovals, or polygons on the canvas. I know it is not
that difficult but it eludes me and i do need the imformation badly. I
have looked at the samples in the tutorial but something still doesnt
click. I think it is as below but i need the general code.  i do not
want to draw with the mouse what i need to do is place a line, point,
polygon, or oval at a precise point in the canvas using the create
command and have it show me the object in the canvas. (create <line>
canvas x1 y1 x2 y2 more...) where i will compute the coordinates by
function calls.
I realize this is probably very minor to you but it is very important
to me and so i think it is something simple as below where just a few
lines need to be added. (is there a create class: point or pixel?)

(module ()
(import swl:oop)
(import swl:macros)
(import swl:generics)
(import swl:option)
(let* ([top (create <toplevel> with (title: "Canvas Example"))]
what goes here to get what I need

respectfully submitted
madmountain


Report this thread to moderator Post Follow-up to this message
Old Post
madman
04-12-05 08:59 PM


Re: need help on chex scheme graphics
madman wrote:

> I would appreciate any help on what to put in the following code to
> place points, lines, ovals, or polygons on the canvas. I know it is not
> that difficult but it eludes me and i do need the imformation badly. I
> have looked at the samples in the tutorial but something still doesnt
> click. I think it is as below but i need the general code.  i do not
> want to draw with the mouse what i need to do is place a line, point,
> polygon, or oval at a precise point in the canvas using the create
> command and have it show me the object in the canvas. (create <line>
> canvas x1 y1 x2 y2 more...) where i will compute the coordinates by
> function calls.
> I realize this is probably very minor to you but it is very important
> to me and so i think it is something simple as below where just a few
> lines need to be added. (is there a create class: point or pixel?)

Is this enough to get you started?

(module ()
(import swl:oop)
(import swl:macros)
(import swl:generics)
(import swl:option)
(define (random-color)
(make <rgb> (random 255) (random 255) (random 255)))
(let* ([top (create <toplevel> with (title: "Canvas Example"))]
[canvas
(create <canvas> top
with
(background-color: (make <rgb> 215 215 255)))]
[shapes
(list (create <rectangle> canvas 10 10 100 100)
(create <oval> canvas 100 20 300 200)
(create <polygon> canvas
10 10
30 40
70 20))])
(for-each (lambda (shape)
(set-outline-color! shape (random-color))
(show shape))
shapes)
(show canvas)
top))

Report this thread to moderator Post Follow-up to this message
Old Post
Abdulaziz Ghuloum
04-13-05 02:00 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.