[TxMt Plugins] sendAction Question

Todd Ditchendorf itod at mac.com
Sat Mar 17 22:39:37 UTC 2007


Kirt, I've done quite a bit of communication from a tm plugin to the  
TM front most window[1][2][3]... I think you should probably try  
something like this:

[[[NSApplication sharedApplication] mainWindow] moveLeft:self]


Note that +[NSApplication sharedApplication] returns an NSApplication  
instance, not a window. An NSApplication handles much of the  
application's lifecycle. A window is represented by NSWindow. The  
frontmost TM editing window can always be fetched by calling - 
[NSApplication mainWindow] on the TM application instance from your  
plugin, as shown above

If I were Allan, I would probably admonish you not to do anything too  
crazy to the frontmost TM window from your plugin, as it might  
surprise users. But then again, as I mentioned, I've probably done  
more peeking under TM's skirt with my plugins than anyone else  
has...  So far Allan hasn't complained ;-]


[1] http://ditchnet.ort/texmlmate
[2] http://ditchnet.ort/texslmate
[3] http://ditchnet.ort/blogmate


Todd Ditchendorf

Scandalous Software - Mac XML Developer Tools
http://scan.dalo.us



On Mar 17, 2007, at 2:52 PM, Kirt Fitzpatrick wrote:

> I am trying to call the moveLeft method on the editor window and I  
> don't seem to be having any luck.  I am a bit of a n00b to  
> Objective C so I assume that I must be missing something.  This is  
> what I came up with.  Am I doing something wrong?
>
> SEL methodSelector = sel_registerName( "moveLeft" );
> [[NSApplication sharedApplication] sendAction:methodSelector to:nil  
> from:self];
>
> kirt
>
> _______________________________________________
> textmate-plugins mailing list
> textmate-plugins at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate-plugins




More information about the textmate-plugins mailing list