From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: NS port horizontal scroll-bars Date: Tue, 26 Apr 2016 10:51:57 +0100 Message-ID: References: <20160424160123.GA37657@breton.local> <20160425203420.GA37698@breton.local> <571F0C30.6080100@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1461664333 13948 80.91.229.3 (26 Apr 2016 09:52:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2016 09:52:13 +0000 (UTC) Cc: Anders Lindgren , emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 26 11:52:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1auzf1-00060P-Ff for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2016 11:52:03 +0200 Original-Received: from localhost ([::1]:37135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auzf0-0004JW-QX for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2016 05:52:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auzex-0004FV-4j for emacs-devel@gnu.org; Tue, 26 Apr 2016 05:52:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auzew-0001kE-38 for emacs-devel@gnu.org; Tue, 26 Apr 2016 05:51:59 -0400 Original-Received: from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]:35913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auzev-0001k4-UE for emacs-devel@gnu.org; Tue, 26 Apr 2016 05:51:58 -0400 Original-Received: by mail-vk0-x243.google.com with SMTP id n67so1191861vkf.3 for ; Tue, 26 Apr 2016 02:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-transfer-encoding; bh=XpcNNpVb7gl8mWafVuWF2ih1AgKf3XKqS46knp5RptA=; b=I+hVr0qi9liKLXMwWWf6cS17Ot3L6kxfA5dIyGUt2hJLOwNKMXEU9z81CZJMYKXhi3 jpPCu1l66FPLOgJVtk0aoWH2+sGCgixQ95R2+i0D2zDzYV7DRi8hiFfJTCYPlHP+4eeB a5VEeeZ7XylkklomZxRu3qaYBOU1c1EtfQ3j45chIOLwVTbfQg7BRgv5FfNR2O1j2EzN GbX+xpOOjSCpBdgCxHlBOim/NVr60fAf9lIfKX0PdW+AqNlQYskvyV+2zNFyfMOdeHQ7 aeFtqXLl9ItrtrO+ZBO1/arnHFFpmzZ7w3pAWjMb5La9RppNew6PMyf9/nmPqyJU40OO APkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=XpcNNpVb7gl8mWafVuWF2ih1AgKf3XKqS46knp5RptA=; b=lFdArgk3oWbJJowHJgiqq6FxSxD4P7Hff8GihMwAWhg7PKToYKndgeYPtw0RSrQH7p Hc/3b5k0EvkFBWYlohl1/KaNY0Ezvz3bLhYYupKzIYb/8hkcoyC6wW0eKOhppQvq+bk+ ma+S4afESJKjoQyw3L83YMi5+eArbA8mKmMmy9IwFxTBG5AjE6GJpdRngpj1QvxcXNZG W0Fy6KY1GCZRqSXpM2lcwfYUmHWyLvqkTQAzP4y+pSpQkhWR1tqH4i5lnSEcN6empvQU sQdosa2VXUmU5v17WgDyfRUeDUfFFqUwOJdFab/XXvJn+doA9uaBWgHS8ZptBxyd3Yld IB5Q== X-Gm-Message-State: AOPr4FVK7OkBsFcxid6qcLjmB3h+SzFaQFsIz+C2IFUbEMoG/x45B+CQ/U/GhnRGhGumY8Zr4R0YIAkC6svtxA== X-Received: by 10.31.63.200 with SMTP id m191mr666677vka.60.1461664317389; Tue, 26 Apr 2016 02:51:57 -0700 (PDT) Original-Received: by 10.159.34.21 with HTTP; Tue, 26 Apr 2016 02:51:57 -0700 (PDT) In-Reply-To: <571F0C30.6080100@gmx.at> X-Google-Sender-Auth: lEFyFLtBADR107PN02hEbYBiOEY X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203327 Archived-At: On 26 April 2016 at 07:35, martin rudalics wrote: >> Is there a function that returns the width of the longest visible >> line, > > You can use =E2=80=98window-text-pixel-size=E2=80=99 for this but I don't= understand > what you need it for. The basic slider size and position calculations > are done in set_horizontal_scroll_bar in xdisp.c and that function calls > the set_horizontal_scroll_bar_hook corresponding to your platform which > should be ns_set_horizontal_scroll_bar. The latter probably needs some > tweaking as for the other platforms. (I've not got the code in front of me right now, so this may be a little vague. I hope you can understand it.) It's actually the other end of the process that I'm struggling with. I write pixel values for dragging the scroll-bar into an emacs_event struct (location of mouse in scroll-bar and total length of scroll-bar), and when that data pops back out in scroll-bar.el it doesn't seem to be any use to the standard scroll-bar functions. For example, with a buffer where the longest line is 300 columns, it's returning values between 0 and 556. As far as I can tell the standard functions are expecting column numbers. I think, from reading the comments in the emacs_event struct definition, that I'm presenting the correct information, so I don't know why it doesn't work. The vertical scroll-bars in the NS port have their own functions defined in ns-win.el, rather than using the functions in scroll-bar.el. I think this is, at least in part, to enable clicking directional arrows in older versions of OS X (and GNUSTEP), but it's doing something different with dragging too. --=20 Alan Third