Re: overridding WorkspacesDisplay



On 14 August 2012 16:47, Jasper St. Pierre <jstpierre mecheye net> wrote:
> On Tue, Aug 14, 2012 at 2:45 AM, Amy C <mathematical coffee gmail com> wrote:
>> Hi all,
>>
>> For some reason, I can't seem to patch WorkspacesDisplay. (I'm trying
>> to define what happens when you scroll your mouse button over the
>> workspace thumbnail sidebar in the overview):
>>
>> const WorkspacesView = imports.ui.workspacesView;
>> const WDproto = WorkspacesView.WorkspacesView.prototype;
>>
>> let storage;
>> function enable () {
>>     storage._onScrollEvent = WDproto._onScrollEvent; // store the original
>>     WDproto._onScrollEvent = function () {
>>         log('stole the scroll event');
>>     };
>> }
>
> When you connect to a signal, it passes the function object, not the
> prototype and function name.

Oh, I guess that makes sense. (I had hoped that by changing
.prototype.eventcallback, that gets replaced *before* _init gets
called (which connects up the signals), hence substituting the
overridden callback instead of the original one).

I have worked around it. cheers!


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