From 374cd11896483fe7a2890f686dd84c21f4f948b8 Mon Sep 17 00:00:00 2001 From: Robert Slover Date: Sun, 14 Jan 2001 15:08:21 +0000 Subject: [PATCH] the principal class can now be set using the GUI git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8594 72102866-910b-0410-8b05-ffd578937521 --- PCBundleProj/PCBundleProject.h | 2 ++ PCBundleProj/PCBundleProject.m | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/PCBundleProj/PCBundleProject.h b/PCBundleProj/PCBundleProject.h index 07de78d..daa30b6 100644 --- a/PCBundleProj/PCBundleProject.h +++ b/PCBundleProj/PCBundleProject.h @@ -64,5 +64,7 @@ - (void)updateValuesFromProjectDict; +- (void)setPrincipalClass:(id)sender; + @end diff --git a/PCBundleProj/PCBundleProject.m b/PCBundleProj/PCBundleProject.m index 7082e80..a339a15 100644 --- a/PCBundleProj/PCBundleProject.m +++ b/PCBundleProj/PCBundleProject.m @@ -52,15 +52,19 @@ [textField setBezeled: NO]; [textField setDrawsBackground: NO]; [textField setStringValue:@"Principal class:"]; - [projectProjectInspectorView addSubview:[textField autorelease]]; + [projectProjectInspectorView addSubview:textField]; + RELEASE(textField); - principalClassField =[[NSTextField alloc] initWithFrame:NSMakeRect(106,240,144,21)]; + frame = NSMakeRect(106,240,144,21); + principalClassField =[[NSTextField alloc] initWithFrame:frame]; [principalClassField setAlignment: NSLeftTextAlignment]; [principalClassField setBordered: YES]; [principalClassField setEditable: YES]; [principalClassField setBezeled: YES]; [principalClassField setDrawsBackground: YES]; [principalClassField setStringValue:@""]; + [principalClassField setTarget:self]; + [principalClassField setAction:@selector(setPrincipalClass:)]; [projectProjectInspectorView addSubview:principalClassField]; } @@ -162,9 +166,23 @@ - (void)updateValuesFromProjectDict { + NSString *pc; + [super updateValuesFromProjectDict]; - [principalClassField setStringValue:[projectDict objectForKey:PCPrincipalClass]]; + pc = [projectDict objectForKey:PCPrincipalClass]; + [principalClassField setStringValue:pc]; +} + +- (void)setPrincipalClass:(id)sender +{ + [projectDict setObject:[principalClassField stringValue] + forKey:PCPrincipalClass]; + + [self writeMakefile]; } @end + + +