comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Where do I get my Cairo context from (in GTK3)?
Date: Wed, 27 Apr 2016 15:37:18 +0200
Date: 2016-04-27T15:37:18+02:00	[thread overview]
Message-ID: <nfqfb9$ma5$1@gioia.aioe.org> (raw)
In-Reply-To: dobsbsF3o8rU1@mid.individual.net

On 27/04/2016 15:15, hreba wrote:

> I am creating a drawing surface, a new layer for isolating the end user
> from GTK. The idea is that the end user gets a constructor for a new
> type "Canvas". He has to specify 3 handlers: the first is called once
> after the canvas appears on the screen, the second is called after each
> resizing, the third one when the canvas needs redrawing. Drawing is done
> by calling a series of of standardized drawing procedures (for lines,
> arcs etc.) The end user needs no knowledge about connecting handlers,
> about cairo contexts or "Stroke" calls. He gets a framework for
> technical drawings with a simple user interface.

I used another approach. Instead of asking the user to draw anything, I 
let him create an object, e.g. a line, which will knows how to draw 
itself. The object is put into a list of objects.

This has the advantage that once done objects can be reused. The user 
need not to care about signals. The objects configuration can be easily 
serialized (e.g. configuration stored and restored). The objects know 
how to resize themselves, e.g. linear objects may become larger, but 
line thickness remain same, some object may wish to keep aspect ratio etc.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2016-04-27 13:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 20:44 Where do I get my Cairo context from (in GTK3)? hreba
2016-04-25  7:40 ` Dmitry A. Kazakov
2016-04-25 10:03   ` hreba
2016-04-25 11:58     ` Dmitry A. Kazakov
2016-04-26  7:22       ` briot.emmanuel
2016-04-26  7:34         ` hreba
2016-04-27  7:47           ` briot.emmanuel
2016-04-27  8:08             ` Dmitry A. Kazakov
2016-04-28  7:48               ` briot.emmanuel
2016-04-27 13:15             ` hreba
2016-04-27 13:37               ` Dmitry A. Kazakov [this message]
2016-04-28  7:49                 ` briot.emmanuel
2016-08-05 15:56 ` borisgaertner56
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox