mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-19 09:50:43 +00:00
Get StepTalk's script panel to work and protect against GNUstep
stubbornly replacing an application's main menu when the scripting menu is loaded. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@34541 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4c834cc46f
commit
520c66f605
5 changed files with 46 additions and 14 deletions
|
@ -1,3 +1,11 @@
|
|||
2012-01-15 Wolfgang Lux <wlux@uni-muenster.de>
|
||||
|
||||
* Source/STApplicationScriptingController.m (-scriptingMenu): Protect
|
||||
against GNUstep stubbornly replacing the application's main menu.
|
||||
|
||||
* Source/STScriptsPanel.m (-selectScript:): Handle case where the
|
||||
script's description is nil.
|
||||
|
||||
2012-01-15 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/STTranscript.h (-window):
|
||||
|
|
|
@ -111,10 +111,28 @@
|
|||
{
|
||||
if(!scriptingMenu)
|
||||
{
|
||||
if(![self loadMyNibNamed:@"ScriptingMenu"])
|
||||
// FIXME ScriptingMenu replaces the application's main menu when it is
|
||||
// loaded, since GNUstep stubbornly considers the first top level menu
|
||||
// in a gorm file to be the application's main menu.
|
||||
NSMenu *mainMenu = RETAIN([NSApp mainMenu]);
|
||||
NS_DURING
|
||||
{
|
||||
return nil;
|
||||
if(![self loadMyNibNamed:@"ScriptingMenu"])
|
||||
{
|
||||
[NSApp setMainMenu:mainMenu];
|
||||
RELEASE(mainMenu);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
[NSApp setMainMenu:mainMenu];
|
||||
RELEASE(mainMenu);
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
[NSApp setMainMenu:mainMenu];
|
||||
RELEASE(mainMenu);
|
||||
}
|
||||
return scriptingMenu;
|
||||
}
|
||||
|
|
|
@ -124,8 +124,11 @@ STScriptsPanel *sharedScriptsPanel = nil;
|
|||
- (void) selectScript: (id)sender
|
||||
{
|
||||
STFileScript *script = [self selectedScript];
|
||||
NSString *description = [script scriptDescription];
|
||||
|
||||
[descriptionText setString:[script scriptDescription]];
|
||||
if (!description)
|
||||
description = @"";
|
||||
[descriptionText setString:description];
|
||||
}
|
||||
|
||||
- (void)command:(id)sender
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2012-01-15 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Documentation/ApplicationScripting.txt: Fix errors.
|
||||
|
||||
2012-01-15 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Frameworks/StepTalk/STEngine.h (-methodFromSource:...):
|
||||
|
|
|
@ -18,11 +18,11 @@ Creating a scriptable application
|
|||
2 Make classes available in ScriptingInfo.plist:
|
||||
|
||||
{
|
||||
STClasses =
|
||||
{
|
||||
Classes =
|
||||
(
|
||||
MessageComposition,
|
||||
InternetAddress
|
||||
};
|
||||
);
|
||||
}
|
||||
|
||||
Add this line to your makefile:
|
||||
|
@ -48,12 +48,11 @@ Creating a scriptable application
|
|||
...
|
||||
if([NSApp isScriptingSupported])
|
||||
{
|
||||
[menu addItemWithTitle: @"Scripting"
|
||||
action: NULL
|
||||
keyEquivalent: @""];
|
||||
|
||||
[menu setSubmenu: [NSApp scriptingMenu]
|
||||
forItem: [menu itemWithTitle:@"Scripting"]];
|
||||
NSMenuItem *scriptingItem =
|
||||
[menu addItemWithTitle: @"Scripting"
|
||||
action: NULL
|
||||
keyEquivalent: @""];
|
||||
[scriptingItem setSubmenu: [NSApp scriptingMenu]];
|
||||
}
|
||||
...
|
||||
|
||||
|
@ -112,7 +111,7 @@ The file is dictionary property list. Kes are:
|
|||
French = {
|
||||
Name = "Some name in french";
|
||||
Description = "Some description in french";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Example
|
||||
|
@ -129,7 +128,7 @@ Example
|
|||
{
|
||||
Description = "This is a script for testing if scripting works";
|
||||
Name = "Test";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
3. Put both files into */Library/StepTalk/Scripts/your_application_name
|
||||
|
|
Loading…
Reference in a new issue