Re: buffer list

From: Scott Weisman <sweis....at.gmail.com>
Date: Fri, 10 Dec 2010 04:48:13 -0800 (PST)

Instead of using a dialog, what about some sort popup, like used for
name completion? Is it possible to use something like that to instead
popup a buffer selection list?

Also, regarding keyboard usage, can the key handler detect events on a
fine-grained-enough level to act on key-up and -down? Eg, if I wanted
to popup something and simulate alt-tab-like behavior where I can hold
the alt key down press or release the tab key, and the selector list
stays visible until I release the alt too.

Scott

On Dec 9, 4:09 pm, mitchell <c....at.caladbolg.net> wrote:
> Hi Scott,
>
> > Is there a way to sort the open buffers that show up in the buffer
> > list in the switch buffer dialog?
>
> Not in the current implementation. The default order is the order in the
> _BUFFERS table so when a selection is made, the dialog (gcocoadialog)
> returns the index of the item selected, hence the index in _BUFFERS so
> it's really easy to make the switch. If you wanted to sort the buffers,
> you'd have to create your own function that calls gui.dialog() using a
> sorted version of _BUFFERS (table.sort using a function that sorts by
> whatever you desire) and either have another column with index in _BUFFERS
> that you can get from what the dialog returns or search _BUFFERS for the
> buffer with the filename selected. It's pretty complicated. There is
> documentation on gcocoadialog towards the bottom of:http://code.google.com/p/gcocoadialog/source/browse/gcocoadialog.c
> You are interested in GCDIALOG_FILTEREDLIST. If you choose
> to keep the same "filename | path" table structure, --output-column would
> be important in this case since you are returning the buffer index or full
> path.
>
> This is complicated stuff so feel free to ask more questions if this is
> what you want to do.
>
> > Also, is it possible to make the up and down arrows roll over, so that
> > up arrow from the top moves to the bottom of the list, and vice versa?
>
> Possibly, but you can just use the 'Home' and 'End' keys. Feel free to
> submit a patch to gcocoadialog though (see above link). I may include it.
>
Received on Fri 10 Dec 2010 - 07:48:13 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:53 EST