[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Graphics/X-windows programming: HowTo begin?



On Sat, 15 Jan 2000, Blazej Sawionek wrote:

> Rick Macdonald wrote:
> > 
> > On Sat, 15 Jan 2000, Blazej Sawionek wrote:
> > 
> > > I need to create a simple graphics application under X:
> > > open a window, mark some rectangular areas on it, than draw some curve lines among those rectangles and that's all.
> > >
> > > Any piece of advice where to begin?
> > 
> > You might consider using tkpaint or modifying it for your needs.

> Apparently I wrongly expressed my needs: what I have to do is to
> visualise a set of data. Visualisation is as simple as I explained
> above. So my idea was to write by myself a piece of software that
> would perform the task.

OK, I saved off my two rectangles and curved line from tkpaint. Besides
some initialization stuff, the rectangles and line have a simple data
format as shown below. You haven't said what format your data is in, but
perhaps you could format it as follows and let tkpaint (or a canabalized
version of it) draw it for you.

(tkpaint will also save postscript for printing)

.c create rectangle 36.0 36.0 230.0 148.0 -tags {Rectangle obj utag1}
.c create rectangle 406.0 184.0 630.0 311.0 -tags {Rectangle obj utag2}
.c create line 231.0 78.9999999993 242.043595636 66.2032514804
254.368476143 54.
6354038979 267.838679915 44.4240676698 282.305610739 35.6818888937
297.609677033
 28.5053066935 313.582052377 22.9734893544 330.046537917 19.1474609794
346.82150
6096 17.0694283039 363.721904277 16.7623150927 380.561296146 18.2295092575
397.1
53918375 21.4548254829 413.316729874 26.4026837745 428.871430995
33.0185019588 4
43.646430446 41.2292978047 457.478738195 50.9444941255 470.215763489
62.05691797
86 481.716998154 74.4439829412 491.855566612 87.9690414194 500.5196255
102.48289
2073 507.613597473 117.825425725 513.059225559 133.827391603 516.796436447
150.3
12264426 518.784003191 167.098191736 519.0 184.0 -smooth 1 -tags {arc arc
obj ut
ag3 spline}

...RickM...


Reply to: