emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NS port horizontal scroll-bars


From: Alan Third
Subject: Re: NS port horizontal scroll-bars
Date: Tue, 26 Apr 2016 10:51:57 +0100

On 26 April 2016 at 07:35, martin rudalics <address@hidden> wrote:
>> Is there a function that returns the width of the longest visible
>> line,
>
> You can use ‘window-text-pixel-size’ 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.

-- 
Alan Third



reply via email to

[Prev in Thread] Current Thread [Next in Thread]