From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: embedding gtk widgets in a buffer Date: Thu, 08 May 2008 01:23:09 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210202857 25430 80.91.229.12 (7 May 2008 23:27:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 May 2008 23:27:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 08 01:28:12 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jtt3T-0001JT-D8 for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 01:28:11 +0200 Original-Received: from localhost ([127.0.0.1]:45911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jtt2l-0002jg-AG for ged-emacs-devel@m.gmane.org; Wed, 07 May 2008 19:27:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jtt2g-0002hn-OM for emacs-devel@gnu.org; Wed, 07 May 2008 19:27:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jtt2b-0002fN-Gy for emacs-devel@gnu.org; Wed, 07 May 2008 19:27:22 -0400 Original-Received: from [199.232.76.173] (port=55698 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jtt2b-0002f1-7I for emacs-devel@gnu.org; Wed, 07 May 2008 19:27:17 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:41433 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jtt2a-00060F-MT for emacs-devel@gnu.org; Wed, 07 May 2008 19:27:17 -0400 Original-Received: from chopper (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id m47NRCXF000509 for ; Thu, 8 May 2008 01:27:13 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96713 Archived-At: I'm working on a patch to embed gtk widgets in a buffer. Its going unexpectedly well! I'm able to embed different types of widgets, and they move with the text rather like images in emacs. I've tested 2 different types of buttons, and an xembed widget. Heres a screenshot: http://www.emacswiki.org/cgi-bin/wiki/EmacsXembedScreenshot Heres the elisp I use to test, which shows the interface: ----------------------------------------- (insert "xwidgetdemo<<< a button. another button\n") (goto-char (point-min)) (put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 1 :type 1 :title "1")) (goto-char 15) (put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 2 :type 2 :title "2")) (goto-char 30) (put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 3 :type 3 :title "3")) ------------------------------------------ Ok, thats rather nice and all, but heres what I dont have: - callback interface for the widgets. It would be nice with some ideas how to do this. For instance: - button pressed handler - when a xembed widget is ready, a callback to start an external program in the widget would be nice, now it has to be done manually on the cmd line - currently all xwidgets must have a unique id, ":xwidget-id 3" for instance. I havent figured out how to handle this. - 2 windows showing the same buffer doesnt quite work and is probably tricky - only 1 frame supported - beautiful code -- Joakim Verona