Re: [code] [textadept] Customize status bar

From: Qwerky <mr.qwerky.att.gmail.com>
Date: Mon, 8 Jul 2019 16:45:14 -0600

Hello,

On 2019-07-08 15:29, Mitchell wrote:
> Hi,
>
> On Mon, 8 Jul 2019, Qwerky wrote:
>
>> Hi,
>>
>> On 2019-07-08 14:26, Qwerky wrote:
>>>
>>> Hello,
>>>
>>> On 2019-07-08 14:11, Mitchell wrote:
>>>> Hi,
>>>>
>>>> On Mon, 8 Jul 2019, Qwerky wrote:
>>>>
>>>>>
>>>>> On 2019-07-08 09:26, Mitchell wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On Sun, 7 Jul 2019, Qwerky wrote:
>>>>>>
>>>>>>> Update.  I found that editing the original ui.lua in place did
>>>>>>> cause
>>>>>>> the
>>>>>>> changes to appear. Then I restored the original ui.lua, and
>>>>>>> found out
>>>>>>> how
>>>>>>> to
>>>>>>> copy just that event handler function to a new file in my
>>>>>>> /userdata/modules/
>>>>>>> directory, edit it there, and then require that module in
>>>>>>> init.lua.  So
>>>>>>> my
>>>>>>> ui.bufstatusbar_text is as desired for now.
>>>>>>>
>>>>>>> But I have not yet learned how to place ui.bufstatusbar on the
>>>>>>> left,
>>>>>>> and
>>>>>>> ui.statusbar on the right.  I have look in the /src/ files, the
>>>>>>> /core/
>>>>>>> files,
>>>>>>> and the /modules/ files, but could not find where those
>>>>>>> positions are
>>>>>>> established.  Need some guidance here.
>>>>>>
>>>>>> In your events, just swap which statusbars you are writing to. For
>>>>>> example,
>>>>>> write buffer information to `ui.statusbar_text`.
>>>>>>
>>>>>> I am glad to hear you are tinkering around with things and
>>>>>> figuring out
>>>>>> how
>>>>>> stuff works. It's the best way to learn :)
>>>>>>
>>>>>> Cheers,
>>>>>> Mitchell
>>>>>
>>>>> :-)  Tinkering is an apt description, as I haven't done any real
>>>>> coding
>>>>> in a
>>>>> long time.  :-)
>>>>>
>>>>> So writing buffer information to ui.statusbar_text is no problem. 
>>>>> But to
>>>>> have messages written to ui.bufstatusbar_text is somewhat of a
>>>>> dilemma,
>>>>> as
>>>>> those messages are written at many various places throughout the
>>>>> modules?
>>>>
>>>> Yeah, perhaps a general search-and-replace in Textadept's source
>>>> would be
>>>> appropriate for you. A quick search showed instances in 5 files.
>>>> That's
>>>> not too bad, but there will be some maintainence involved for you
>>>> if/when
>>>> you upgrade to newer versions.
>>>>
>>>> Cheers,
>>>> Mitchell
>>>
>>> Okay.  When you say "Textadept's source" are you referring to the .lua
>>> modules, or the .c files in /src/, or both?
>>>
>>> One other thing:  when my events handler writes the buffer
>>> information to
>>> ui.statusbar_text (left side of status bar), the original buffer
>>> information still appears on the right side of the status bar.  I
>>> understood from the documentation, that if my handler returns a
>>> value, then
>>> no others handlers (for that event) would be processed.  I've tried
>>> returning both 'true' and 'false', but the original buffer information
>>> still appears on the right side.  Is something else needed?
>
> I would manually call `ui.bufstatusbar_text = ''` in your event
> handler to clear the buffer statusbar.
>
>> [snip]
>>
>> Having a quick look at textadept.c, it seems that it could be as
>> simple as
>> swapping elements '0' and '1' in statusbar[2] (and
>> statusbar_lenght[2]).  But
>> if that file were modified, then it would need to be recompiled,
>> correct?  So
>> that is something that couldn't be done by me, but could by you.
>
> If you are on Linux, you could totally recompile by yourself following
> the instructions in the manual. In fact, thanks for reminding me; that
> would probably be the easiest route.
>
> Cheers,
> Mitchell

Naw, I'm using Windows (I hear that snickering in the background!).  :-)

qwerky

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 08 Jul 2019 - 18:45:14 EDT

This archive was generated by hypermail 2.2.0 : Tue 09 Jul 2019 - 06:50:19 EDT