Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8443887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:15:35+00:00 2026-06-10T09:15:35+00:00

I am trying to make a simple drawing application using Python and gnomecanvas. Sadly,

  • 0

I am trying to make a simple drawing application using Python and gnomecanvas. Sadly, there appears to be no documentation for the Python bindings for gnomecanvas whatsoever. Thus, I am bumbling around using code samples and trying to guess from the C bindings.

As it is, I have the code working by keeping a list of current points in a stroke and generating a new path object from this list at each new item:

def get_pointer_coords(self, event):
    return self.window_to_world(event.x, event.y)

def render_path(self):
    path_def = gnomecanvas.path_def_new(self.cur_path)
    self.current_item.set_bpath(path_def)

def button_press(self, event):
    is_core = event.device is gdk.device_get_core_pointer()
    if is_core:
        return
    self.drawing = True
    (x, y) = self.get_pointer_coords(event)
    self.cur_path = [(gnomecanvas.MOVETO_OPEN, x, y)]
    self.current_item = self.root().add( gnomecanvas.CanvasBpath
                                       , outline_color="#A6E22E"
                                       , width_pixels=1
                                       , cap_style=gdk.CAP_ROUND
                                       )

def button_release(self, event):
    self.drawing = False

def motion_notify(self, event):
    is_core = event.device is gdk.device_get_core_pointer()
    if not is_core and self.drawing:
        (x, y) = self.get_pointer_coords(event)
        self.cur_path.append((gnomecanvas.LINETO, x, y))
        self.render_path()

This seems to me to be a rather inefficient method: generating a new object every time the pointer moves; and considering I’m getting subpixel precision from my tablet this is rather often.

My question is: is there a way by which I can simply append to the existing bpath on each pointer motion as I would in the C version of this library?

On a related note, is there any documentation for this API because I have done hours of Googling which have given me nothing in return.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:15:36+00:00Added an answer on June 10, 2026 at 9:15 am

    There’s good libgnomecavas 2.3 documentation on native C API, that contains description for all C functions to work with gnomecanvas.

    Python bindings do not expose all the described API in general, and your desired functions in particular, and there’s no documentation on Python bindings for gnome canvas, all forces were sent to develop Gnome3-related things (you can explore it at live.gnome.org).

    Another thing is that gnomecavas is quite outdated and Python bindings too; and there’s no plans to support them in future (e.g. last several versions of Ubuntu has this package just being copied from version to version without any changes).

    But there’s another canvas library called GooCanvas which uses Cairo to draw on screen and seems to be more up-to-date, having PyGooCanvas Python bindings and used by some widespread projects, like Pitivi.


    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a simple drawing program in python using pygame. I
I'm trying to make simple library blake hash function wrapper using python ctypes from
I'm trying to make simple application using Spring, JPA and embedded H2 database. Recently
I'm trying to make a simple drawing app in c++, but i'm having trouble
Trying to make simple minesweeper game in python, but have one problem. I have
I am trying to make simple notepad application for learning android development. So, to
I'm trying to make simple script using jquery $post function to pass data to
I'm trying make my first python app. I want make simple email sender form.
I'm trying to make simple many-to-one association, using NHibernate.. I have class Recruit with
I'm trying to make simple use of the NSNotification center inside my iPhone application,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.