[TxMt] DIALOG2: open save panels > question

Hans-Joerg Bibiko bibiko at eva.mpg.de
Mon Mar 31 12:24:12 UTC 2008


Hi,

I'm just writing the extension for DIALOG2 to show up a user-defined  
open/save panel optionally with an accessory view.

I can call it like:

"$DIALOG" panel open -p '{message="Input"; button1 = Load;  
allowMultipleSelection = 1; startDir = "/usr/bin/"; string=ANNA;  
switch=1;}'  ~/Desktop/acc.nib

whereby 'string' and 'switch' are set in the accessory view  
(TextIInputField and a Checkbox) specified in acc.nib. It works fine.

Now I tried to show these panels as sheets bound to the current  
window. This also works fine ;)
BUT: I do not know how to write the 'resultDict' plist back to TM if  
I'm using sheets :{
(NSLog() shows the correct plist)

If I show up the panels as windows I'm using:
[TMDCommand writePropertyList:resultDict toFileHandle:[proxy  
outputHandle]];

called within '(void)handleCommand:(CLIProxy*)proxy'

Fine. But if I'm using sheets then I have to call:
[openPanel beginSheetForDirectory: startDir
			 file: [parameters objectForKey:@"file"]
			types: fileTypes
	       modalForWindow: documentWindow
		modalDelegate: self
	       didEndSelector:  
@selector(openPanelDidEnd:returnCode:contextInfo:)
		  contextInfo: nil];

within '(void)handleCommand:(CLIProxy*)proxy' and this means I have to  
leave the method '(void)handleCommand:(CLIProxy*)proxy'

My method to handle the sheet after closing is
- (void)openPanelDidEnd:(NSOpenPanel*)openPanel returnCode: 
(int)returnCode contextInfo:(void*)contextInfo

and I didn't find a way to get access to TMDCommand's [proxy  
outputHandle]. I tried to copy the handle, to set proxy as class  
variable, etc. I directly wrote to stdout but it's redirected.


Is there anyone who can give me an hint? (If it would be better to  
post the preliminary code for panel.mm, please let it me know)

Thanks
--Hans





More information about the textmate mailing list