From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs canvas support Date: Wed, 29 Apr 2020 13:10:11 +0300 Message-ID: <83sggmzjp8.fsf@gnu.org> References: <875zdikdge.fsf.ref@yahoo.com> <875zdikdge.fsf@yahoo.com> <834kt21yyo.fsf@gnu.org> <87zhau1uog.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="8495"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 29 12:11:15 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTjgQ-00027c-Po for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 12:11:14 +0200 Original-Received: from localhost ([::1]:47016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTjgP-0000kG-Re for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 06:11:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38368) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTjfj-0008IU-KF for emacs-devel@gnu.org; Wed, 29 Apr 2020 06:10:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51791) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTjfj-0004bb-BT; Wed, 29 Apr 2020 06:10:31 -0400 Original-Received: from [176.228.60.248] (port=3325 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jTjfh-0008Rq-HC; Wed, 29 Apr 2020 06:10:30 -0400 In-Reply-To: <87zhau1uog.fsf@yahoo.com> (message from Po Lu on Wed, 29 Apr 2020 17:57:03 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248106 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Wed, 29 Apr 2020 17:57:03 +0800 > > > I've read the code and the docs, but I don't think I have a clear idea > > of what "canvases" are and what would be their intended usage. > > Perhaps consider starting the documentation with some introductory > > comments and even a small tutorial. > > A canvas is an object that contains memory that can be painted to, and > then displayed by setting it as the `display' text property. That's the technical description of the implementation. It doesn't explain when canvases can be useful and for what purposes. > > It sounds like you are talking about a way to create images > > dynamically, but then I don't understand why we need canvas-from-image, > > for example. > > It's not really a way to create images dynamically, but rather paint to > a section of the screen. But the result of this painting is some graphical object, similar to an image, that will be displayed within a buffer, right? > > Also, is there support for clicking the mouse on a canvas? I don't > > see it. > > You can bind mouse events as usual. Did I miss the code that tells Emacs the click was on a canvas? E.g., if you click on a canvas, what does posn-object return when passed the click event as its argument?