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

Re: [sc-users] Main.sc and stand-alone application



This latest error isn't your fault. It's trying to add items to the Help menu but I would guess that the Help menu on your system is named something other than "Help." In that case, it appears in the objective-c source that it will fail to find the menu and return a wrong type error.

As a temporary workaround, go into OSXPlatform and comment out this line from the startup method:

Help.addToMenu;


Scott W, whoever else was working on the help tree, seems to me we at least need to put *addToMenu in a try block and post a warning on failure. This kind of thing shouldn't be fatal.

Beyond that, locale awareness would be nice but I have no idea how to do it. Maybe there is an alternative to itemWithTitle here? Or the obj-c layer might have access to the system locale.

if (strcmp(parentSymbol->name, "Help")==0) {
parentMenu = [[[NSApp mainMenu] itemWithTitle:@"Help"] submenu];

hjh


On Dec 26, 2008, at 2:27 AM, Usami Tadashi wrote:

Sorry to bother you over and over again...
I downloaded 3.3 alpha, unzipped, and installed into /Applications.
I put myApp.rtf in /Applications/SuperCollider.
I changed?/Applications/SuperCollider/SCClassLibrary/DefaultLibrary/Main.sc
with addition of:
interpreter.executeFile(String.scDir ++ "/myApp.rtf");
Then, I was able to start up SC, just as usual. My application didn't come up.
The post window says:
ERROR: Primitive '_NewMenuItem' failed.
Wrong type.
RECEIVER:
Instance of CocoaMenuItem {? ? (154D7B00, gc=EC, fmt=00, flg=00, set=03)
? instance variables [7]
? ? dataptr : RawPointer 55D950
? ? name : "Help Tree"
? ? parent : Symbol 'Help'
? ? children : nil
? ? state : false
? ? isBranch : true
? ? action : nil
}
CALL STACK:
MethodError:reportError ? 15573B90
arg this = <instance of PrimitiveFailedError>
Nil:handleError ? 15571670
arg this = nil
arg error = <instance of PrimitiveFailedError>
Thread:handleError ? 15576320
arg this = <instance of Thread>
arg error = <instance of PrimitiveFailedError>
Object:throw ? 15574910
arg this = <instance of PrimitiveFailedError>
Object:primitiveFailed ? 15572030
arg this = <instance of CocoaMenuItem>
CocoaMenuItem:init ? 15E36190
arg this = <instance of CocoaMenuItem>
arg argparent = 'Help'
arg argindex = 8
arg argname = "Help Tree"
arg hasSubmenu = true
arg argaction = nil
< FunctionDef in Method Meta_Help:addToMenu> ? 15E360F0
arg parent = 'Help'
arg dict = <instance of Dictionary>
arg name = "Help Tree"
arg index = 8
var menu = nil
var keys = nil
Meta_Help:addToMenu ? 155D11E0
arg this = class Help
var ugens = nil
var menu = nil
var addSubMenu = <instance of Function>
OSXPlatform:startup ? 154C3C20
arg this = <instance of OSXPlatform>
Main:startup ? 154C3BC0
arg this = <instance of Main>


Maybe I made a very stupid mistake. Any hints?

Tadashi


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman