compiler deploy

Coding Questions, IDE related or anything else

compiler deploy

Postby zaphod » Sun Feb 14, 2010 10:39 am

Hello,
i just discovered objective basic...

2 questions :
1/
With the function deploy what become the size of compiled app (in comparison with the standard build function) ?
(i use the free version and this function is disabled)

2/
How can i stop my app when i close the dialog ?
zaphod
 
Posts: 1
Joined: Fri Feb 12, 2010 10:17 pm

Re: compiler deploy

Postby berndnoetscher » Mon Feb 15, 2010 10:08 am

You need the following event procedure at the correct place of code.

Code: Select all
Event WindowWillClose()
  'Alert("WindowWillClose")
  NSApplication.Terminate(Me) ' will quit your app
End Event


Where to place depends on the creation of the window.
1) The default way:
You use

Code: Select all
Event AwakeFromNib()
  mywindow.Delegate = Me ' set the delegate of the NSWindow in code.
End Event

IBOutlet mywindow As NSWindow
 
Event WindowWillClose()
  NSApplication.Terminate(Me)
End Event


and create a windows in Interface Builder, and connect the IBOutlet in Interface Builder. Therefore, you need additional to set the delegate of the NSWindow in code or Interface Builder.
Attached you will find a small example doing that only.

By the way, make sure that "Release When Closed" is not set in Interface Builder for your NSWindow, otherwise your app will crash.

2) If you created it in code in some code file by something like

Code: Select all
Dim mywindow As NSWindow


the Event WindowWillClose() must be there as well and don't forget to set the delegate of the NSWindow in code as well.
Attachments
WindowWillClose.zip
(211.88 KiB) Downloaded 87 times
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: compiler deploy

Postby berndnoetscher » Mon Feb 15, 2010 10:29 am

zaphod wrote:With the function deploy what become the size of compiled app (in comparison with the standard build function) ?
(i use the free version and this function is disabled)


The size is the same yet, but it might be optimized in future releases. Deploying only needed functions of the ObjB runtime for example.
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am


Return to Objective-Basic (Xcode 3)

Who is online

Users browsing this forum: No registered users and 1 guest

cron