Page 1 of 1

compiler deploy

PostPosted: Sun Feb 14, 2010 10:39 am
by zaphod
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 ?

Re: compiler deploy

PostPosted: Mon Feb 15, 2010 10:08 am
by berndnoetscher
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.

Re: compiler deploy

PostPosted: Mon Feb 15, 2010 10:29 am
by berndnoetscher
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.