[Sc-devel] [approve?] Main Help resize on OSX
Scott Wilson
i at scottwilson.ca
Wed Nov 14 20:58:26 PST 2007
Okay, I was wondering about that. Maybe we should forget it then.
S.
On 14 Nov 2007, at 20:02, nescivi wrote:
> Hmm...
> reformatting in what way?
>
> I don't think a fourth column will look good in w3m, unless you maybe
> go to fullscreen, but this is not default. Things might get more
> cluttered within each column of the table...
>
> sincerely,
> Marije
>
> On 11/11/07, Scott Wilson <i at scottwilson.ca> wrote:
>> Should I commit this? Main help could then be reformatted to take
>> advantage of a larger window.
>>
>> S.
>>
>> On 10 Nov 2007, at 13:29, Scott Wilson wrote:
>>
>>>
>>> On 10 Nov 2007, at 11:13, Click Nilson wrote:
>>>
>>>> I'd have a problem with this.
>>>>
>>>> We discussed that text at length pre 3.1. Instructions on how to
>>>> use help, and useful shortcuts, must appear in the main help page.
>>>> Else it's not friendly. And it really doesn't matter if others see
>>>> it multiple times; the code links etc are still helpful each time.
>>>>
>>>> The SC Help system has to cover newbies straight away, not be
>>>> deferring them to another page.
>>>>
>>>> Perhaps the only issue is fitting all links on screen at once;
>>>> could the default main help window size be a little bigger?
>>>
>>> I had a quick pass at doing this. This works, but you can see the
>>> resize happen. Does anyone know if there's a better way?
>>>
>>> S.
>>>
>>> - (BOOL)readFromFile:(NSString *)path ofType:(NSString *)aType
>>> {
>>> NSURL *url = [NSURL fileURLWithPath: path];
>>> BOOL success = NO;
>>>
>>> if (!initTextView) initTextView = [self makeTextView];
>>> NSTextStorage* text = [initTextView textStorage];
>>>
>>> [text beginEditing]; // Bracket with begin/end editing for
>>> efficiency
>>> [[text mutableString] setString:@""]; // Empty the document
>>>
>>> NSString* extension = [path pathExtension];
>>>
>>> if ([extension isEqualToString: @"html"] || [extension
>>> isEqualToString: @"htm"]) {
>>> NSAttributedString *htmlAttributedString = [HTMLRenderer
>>> attributedStringWithURL:url];
>>>
>>> if(!htmlAttributedString) success = NO;
>>> else {
>>> [text setAttributedString:htmlAttributedString];
>>> [initTextView setDefaultTabsTo: 28.0f];
>>> success = YES;
>>> }
>>> }
>>> else {
>>> NSError *error;
>>> success = [text readFromURL:url options:nil
>>> documentAttributes:nil error:&error];
>>> if(!success) NSLog(@"Error opening file: %@", error);
>>> }
>>>
>>> if ([extension isEqualToString: @"sc"] || [extension
>>> isEqualToString: @"scd"]) {
>>> [initTextView setFont: [NSFont fontWithName: @"Monaco" size: 9]];
>>> SyntaxColorize(initTextView);
>>> }
>>>
>>> [text endEditing];
>>>
>>> if ([[path lastPathComponent] isEqualToString: @"Help.html"]) {
>>>
>>> SEL sel = @selector(resizeMainHelp);
>>> NSMethodSignature *sig = [MyDocument
>>> instanceMethodSignatureForSelector: sel];
>>>
>>> NSInvocation *anInvocation = [NSInvocation
>>> invocationWithMethodSignature: sig];
>>> SCVirtualMachine* scvm = [SCVirtualMachine sharedInstance];
>>> [anInvocation setTarget: self];
>>> [anInvocation setSelector: sel];
>>> [scvm defer: anInvocation];
>>> }
>>>
>>> // in case of html with images, etc.
>>> [self setpathToSaveAttachments:[[[path
>>> stringByDeletingLastPathComponent] stringByAppendingPathComponent:
>>> @"attachments"] stringByAppendingPathComponent: [[path
>>> lastPathComponent] stringByDeletingPathExtension]]];
>>> return success;
>>> }
>>>
>>> - (void)resizeMainHelp
>>> {
>>> NSWindow *window = [[self textView] window];
>>> NSPoint origin = [window frame].origin;
>>> [window setFrame:NSMakeRect(origin.x, origin.y, 800,600)
>>> display:YES];
>>> }
>>> _______________________________________________
>>> Sc-devel mailing list
>>> Sc-devel at create.ucsb.edu
>>> http://www.create.ucsb.edu/mailman/listinfo/sc-devel
>>
>>
> _______________________________________________
> Sc-devel mailing list
> Sc-devel at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-devel
More information about the Sc-devel
mailing list