473,414 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Objective Cairo

As pycairo is one of the less pythonish things I ever saw, it went into
my mind to create some sort of objective wrapper over its python api
making graphic manipulation much more coherent to the python way.

As of the moment, I can:
- create (and reorder) multiple layers (this is not present in the
original cairo, but it is an easy addiction)
- draw, move and delete Rectangles, Lines and (simple) Texts

This is particularly useful when combined with user interaction: I
wrote a simple demo that, without redrawing everything, allows me to
move a square up and down my canvas by pressing some buttons.

Before going on with more complex forms and objects, I was wondering if
this could be useful to anyone or if I'd better giving up.

A few example lines:

import objcairo
context = objcairo.Context()
layer = context.Layer()
rect = layer.Rectangle(10, 10, 200, 100)
rect.stroke((1,0,0))
rect.fill((0,1,0))
rect.move_down(20)
context.draw(some_cairo_context)

So, what do you think?

Mar 22 '06 #1
1 1542
fe**************@gmail.com wrote:
As pycairo is one of the less pythonish things I ever saw, it went into
my mind to create some sort of objective wrapper over its python api
making graphic manipulation much more coherent to the python way.
[...]
Before going on with more complex forms and objects, I was wondering if
this could be useful to anyone or if I'd better giving up.


What you've done looks interesting. However, before venturing too far,
I'd recommend looking at the other graphics APIs for Python and keeping
as compatible as possible to the way they do things (without offending
your sense of "Pythonicity" or conflicting with the Cairo mechanisms,
of course). Sadly, I'm not really up-to-date with what people use for
canvas-style drawing in Python - once upon a time there was the Piddle
project, renamed to Sping, and then seemingly abandoned - but I'm sure
a few people can suggest similar projects.

Keep up the good work, though!

Paul

Mar 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: j_mckitrick | last post by:
Hi all! I've heard good things about SmallTalk, and I read that the IDE is extremely productive. Why is this the case? What are the technical points where Python and SmallTalk differ? Is...
1
by: edo | last post by:
JS program to score any objective test http://www.psychology.org/cgi-bin/links2/jump.cgi?ID=3913
2
by: David | last post by:
Anyone know of objective a survey of the development time and run-time considerations of PHP vs. ASP.NET vs JSP? Most arguments for one environment appear to be more on the personal level. ...
0
by: Michax | last post by:
Hi, I have problem with my py2exe. When I want to run my compiled exe, then i get error information like that: Trackback (most recent call last): File "mysql_gui.py", line 2 in ? File...
0
by: _wolf | last post by:
cairo@cairographics.org] hi all, i've heard cairo has become the image scling library for firefox3. is that true? wonderful, i want to do that in python. there's a python interface for cairo,...
0
by: Tim Grove | last post by:
Thanks for your advice Gerdus, but I have tried your suggestion with no success. It has at least been beneficial to discover a tool which I did not know about in 'Dependency Walker'; all...
0
by: babu8880 | last post by:
www.convensysglobal.com/elearn You can login and attend courses and similar resources ask your doubts from experienced engineers in iphone and Objective C Domain You can attend live classes...
2
by: flagos | last post by:
Hi to all! Any of you know if it's possible to use the Cairo graphics library in a WIN32 c# application? I know there is a binding made for Mono but my app will run on win32 so obviously I wont...
4
by: wayneface | last post by:
hey guys im quite new to programming and have been teaching myself c, ive come to the point where object orientated languages are calling to me but i can't decide weather to go onto objective - c or...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.