discuss-gnustep
[Top][All Lists]
Advanced

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

Re: custom options during save in a document app


From: Riccardo Mottola
Subject: Re: custom options during save in a document app
Date: Sat, 06 Oct 2012 22:33:43 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120909 Firefox/15.0.1 SeaMonkey/2.12.1

Hi,

thanks Wolfgang, I have some dirty, but almost working code. I shuffle the view on panel creation, I was unablle to dynamically
Riccardo Mottola wrote:


You might add a declaration
@interface NSDocument(Hidden)
- (void)changeSaveType: (NSString *)fileType;
@end
to get rid of the warning.
apparently it is of type (id)sender. Read below.
The new file type is passed as argument to the -changeSaveType: method.
It appears instead that the sender is passed: NSPopUpButton, I printed out the sender.

I made a hack now to use pos.1 and pos2.. just to test (it is bad of course, since the order and generally the filetypes might change). It shows the concept can work, I will commit it so you can see it and i can test it on gnustep too.

Besides the file-type hack, other two things need a solution:
- on load, I don't know how to "initialize" the values. In my old code, I issued a message to simulate a "click" on the popupbutton, which thus syncronized all the values. Here I don't have a reference to the popupbutton to click! Also I can't assume that the default filetype is TIFF or JPEG for example - the document "remembers" how it was last saved! so once it has a filetype, the next time you do saveAs it removes the accessory view!. Also TextEdit doesn't behave this way, so I fear it is something I do. Perhaps the accessoryView doesn't get regenerated? I don't know, the documentation says it gets released, thus I suppose it is logically recreated the next time.


Riccardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]