Author Topic: call_list notifications?  (Read 276 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1407
  • Hero Points: 107
  • Text
call_list notifications?
« on: July 25, 2017, 05:52:27 pm »
Is there any documentation on the notifications sent by call_list?

I've stumbled across a couple in the docs, but there doesn't seem to be a central list of them - or even a good way to search for them.

Searching for calls to call_list in slick\macros, I've made a list of 62 different ones, but ideally there would be some docs to go along with these.


For example, I've got a toolbar that I want to have in sync with whatever the current buffer is (showing the current buffer encoding)
I have a _switchbuf_*() function, but this doesn't catch all cases I need it to.
I don't even know what all the cases might be - not without a lot of testing at least.
Save-as is a problem - I found that on save-as it does sent a _switchbuf_ notification, but it apparently happens before the buffer name is changed.

So which notifications should I get?

Graeme

  • Senior Community Member
  • Posts: 1981
  • Hero Points: 226
Re: call_list notifications?
« Reply #1 on: July 25, 2017, 11:31:19 pm »
You could use a half second timer to check what the current buffer is.  That's what I do in xretrace.
_use_timers is used in a variety of slick macro code.

Code: [Select]
static int retrace_timer_handle;
// ...

   retrace_timer_handle = _set_timer(retrace_timer_rate, retrace_timer_callback1);

  // ...
static void retrace_timer_callback1()
{
   if (!_use_timers || retrace_timer_handle < 0)
      return;
   if (_no_child_windows()) {
      retrace_startup_counter = 0;
      return;
   }


Graeme

  • Senior Community Member
  • Posts: 1981
  • Hero Points: 226
Re: call_list notifications?
« Reply #2 on: July 26, 2017, 03:19:01 am »
I just realised my code might not work if the edit buffer is open in a window that isn't the main mdi window.  I use _mdi.p_child.p_buf_name to get the name of the current buffer.  My code appears to still work but I don't know why.