<refentry id="GtkOSXApplication">
<refmeta>
<refentrytitle role="top_of_page" id="GtkOSXApplication.top_of_page">GtkOSXApplication</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK-MAC-INTEGRATION Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkOSXApplication</refname>
<refpurpose>Base class for OSX integration</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkOSXApplication.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtkosxapplication.h&gt;

                    <link linkend="GtkOSXApplicationPrivate">GtkOSXApplicationPrivate</link>;
                    <link linkend="GtkOSXApplicationMenuGroup">GtkOSXApplicationMenuGroup</link>;
                    <link linkend="GtkOSXApplication-struct">GtkOSXApplication</link>;
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-ready">gtk_osxapplication_ready</link>            (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-cleanup">gtk_osxapplication_cleanup</link>          (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-use-quartz-accelerators">gtk_osxapplication_set_use_quartz_accelerators</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="gboolean">gboolean</link> use_quartz_accelerators);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-osxapplication-use-quartz-accelerators">gtk_osxapplication_use_quartz_accelerators</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-menu-bar">gtk_osxapplication_set_menu_bar</link>     (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-sync-menubar">gtk_osxapplication_sync_menubar</link>     (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-insert-app-menu-item">gtk_osxapplication_insert_app_menu_item</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item,
                                                         <link linkend="gint">gint</link> index);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-window-menu">gtk_osxapplication_set_window_menu</link>  (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-help-menu">gtk_osxapplication_set_help_menu</link>    (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
enum                <link linkend="GtkOSXApplicationAttentionType">GtkOSXApplicationAttentionType</link>;
#define             <link linkend="GTK-TYPE-OSX-APPLICATION-ATTENTION-TYPE--CAPS">GTK_TYPE_OSX_APPLICATION_ATTENTION_TYPE</link>
<link linkend="GType">GType</link>               <link linkend="gtk-type-osxapplication-attention-type-get-type">gtk_type_osxapplication_attention_type_get_type</link>
                                                        (void);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-dock-menu">gtk_osxapplication_set_dock_menu</link>    (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-dock-icon-pixbuf">gtk_osxapplication_set_dock_icon_pixbuf</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-set-dock-icon-resource">gtk_osxapplication_set_dock_icon_resource</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *type,
                                                         const <link linkend="gchar">gchar</link> *subdir);
<link linkend="gint">gint</link>                <link linkend="gtk-osxapplication-attention-request">gtk_osxapplication_attention_request</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkOSXApplicationAttentionType">GtkOSXApplicationAttentionType</link> type);
<link linkend="void">void</link>                <link linkend="gtk-osxapplication-cancel-attention-request">gtk_osxapplication_cancel_attention_request</link>
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="gint">gint</link> id);
<link linkend="gchar">gchar</link> *             <link linkend="quartz-application-get-bundle-path">quartz_application_get_bundle_path</link>  (void);
<link linkend="gchar">gchar</link> *             <link linkend="quartz-application-get-resource-path">quartz_application_get_resource_path</link>
                                                        (void);
<link linkend="gchar">gchar</link> *             <link linkend="quartz-application-get-executable-path">quartz_application_get_executable_path</link>
                                                        (void);
<link linkend="gchar">gchar</link> *             <link linkend="quartz-application-get-bundle-id">quartz_application_get_bundle_id</link>    (void);
<link linkend="gchar">gchar</link> *             <link linkend="quartz-application-get-bundle-info">quartz_application_get_bundle_info</link>  (const <link linkend="gchar">gchar</link> *key);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkOSXApplication.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GtkOSXApplication
</synopsis>
</refsect1>






<refsect1 id="GtkOSXApplication.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkOSXApplication-NSApplicationBlockTermination">NSApplicationBlockTermination</link>&quot;                  : No Recursion / Action
  &quot;<link linkend="GtkOSXApplication-NSApplicationDidBecomeActive">NSApplicationDidBecomeActive</link>&quot;                   : No Recursion / Action
  &quot;<link linkend="GtkOSXApplication-NSApplicationOpenFile">NSApplicationOpenFile</link>&quot;                          : No Recursion / Action
  &quot;<link linkend="GtkOSXApplication-NSApplicationWillResignActive">NSApplicationWillResignActive</link>&quot;                  : No Recursion / Action
  &quot;<link linkend="GtkOSXApplication-NSApplicationWillTerminate">NSApplicationWillTerminate</link>&quot;                     : No Recursion / Action
</synopsis>
</refsect1>


<refsect1 id="GtkOSXApplication.description" role="desc">
<title role="desc.title">Description</title>
<para>
Exposes to the Gtk+ program important functions of
OSX's NSApplication class for use by Gtk+ applications running with
the quartz Gdk backend and provides addtional functions for
integrating a Gtk+ program into the OSX user environment.
</para>
<para>
Using GtkOSXApplication is pretty simple.
First, create an instance at startup:
</para>
<para>
<informalexample><programlisting>GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);</programlisting></informalexample>
</para>
<para>
Do this early in your program, shortly after you run
<informalexample><programlisting>gtk_init()</programlisting></informalexample>. Don't forget to guard it, and all other calls into
the library, with <informalexample><programlisting>#ifdef MAC_INTEGRATION</programlisting></informalexample>. You don't want your
Linux users' builds failing because of this.  The application
object is a singleton, so you can call g_object_new as often as you
like. You'll always get the same pointer back. There's no need to
pass it around as an argument. Do note that all of the
GtkOSXApplication functions take theApp as an argument, even if
they don't use it. This seems silly in C, and perhaps it is, but
it's needed to make the Python binding logic recognize that they're
class methods.
</para>
<para>
Just having the application object created will get you some
benefits, like having the Quit menu item in the dock menu work. But
you'll obviously want more. So the next place to visit is your main
window code. If you have a simple application, you might be
constructing the menu by hand, but you're more likely to be using
GtkBuilder. In either case, you need to get a pointer to the
menubar. If you're building by hand, you've already got it lying
around because you needed it to add the menus to. With GtkBuilder,
you need to ask the GtkUIManager for a pointer. Once everything is
more-or-less set up on the Gtk+ side, you need only hide the menu
and call <link linkend="gtk-osxapplication-set-main-menu"><function>gtk_osxapplication_set_main_menu()</function></link>. Here's an example with
GtkBuilder:
</para>
<para>
<example>
<title>Setting the MenuBar</title>
<programlisting>
  GtkUIManager *mgr = gtk_ui_manager_new();
  GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
  ...
  mergeid = gtk_ui_manager_add_ui_from_file(mgr, "src/testui.xml", &amp;err);
  ...
  menubar = gtk_ui_manager_get_widget(mgr, "/menubar");
  gtk_widget_hide (menubar);
  gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
</programlisting>
</example>
</para>
<para>
There are a couple of wrinkles, though, if you use
accelerators. First off, there are two event paths for
accelerators: Quartz, where the keystroke is processed by OSX and
the menu item action event is placed on the event queue by OSX, or
Gtk, where the accelerator key event is passed through to Gtk to
recognize. This is controlled by
<link linkend="gtk-osxapplication-set-use-quartz-accelerators"><function>gtk_osxapplication_set_use_quartz_accelerators()</function></link> (you can test the
value with <link linkend="gtk-osxapplication-use-quartz-accelerators"><function>gtk_osxapplication_use_quartz_accelerators()</function></link>), and the
default is to use Quartz handling. This has two advantages:
<itemizedlist>
<listitem><para>It works without any extra steps</para></listitem>
<listitem><para>
It changes stock accelerators (like Ctrl-O for open file) to
the stock OSX keyEquivalent (Cmd-O in that case).
</para></listitem>
</itemizedlist>
If you need to use Gtk+ keyboard accelerator handling <emphasis>and</emphasis>
you're using GtkMenuItems instead of GtkActions, you'll need to
connect a special handler as shown in the following example:
<example>
<title>Enabling Accelerators on Hidden Menus</title>
<programlisting>
static gboolean
can_activate_cb(GtkWidget* widget, guint signal_id, gpointer data)
{
  return gtk_widget_is_sensitive(widget);
}
...
  g_signal_connect(menubar, "can-activate-accel", 
                   G_CALLBACK(can_activate_cb), NULL);
</programlisting>
</example>
</para>
<para>
The next task to make your application appear more normal for Mac
users is to move some menu items from their normal Gtk locations to
the so-called "App" menu. That's the menu all the way at the left
of the menubar that has the currently-running application's
name. There are 3 menu items that normally go there:
<itemizedlist>
<listitem><para>Help|About</para></listitem>
<listitem><para>Edit|Preferences</para></listitem>
<listitem><para>File|Quit</para></listitem>
</itemizedlist>
File|Quit is a special case, because OSX handles it itself and
automatically includes it, so the only thing you need do is hide it
on the File menu so that it doesn't show up twice:
<informalexample><programlisting>gtk_widget_hide(GTK_WIDGET(file_quit_menu_item));</programlisting></informalexample>
The other two must be moved in code, and there are two functions
for doing that. The first one creates "goups", which is just an
easy way to manage separators, and the second adds the actual menu
items to the groups. Here's an example:
<example>
<programlisting>
 GtkOSXApplicationMenuGroup *group;
 GtkMenuItem *about_item, *preferences_item;
 about_item = gtk_ui_manager_get_widget(mgr, "/menubar/Help/About");
 preferences_item = gtk_ui_manager_get_widget(mgr, "/menubar/Edit/Preferences");

 group = gtk_osxapplication_add_app_menu_group (theApp);
 gtk_osxapplication_add_app_menu_item  (theApp, group,
                                        GTK_MENU_ITEM (about_item));

 group = gtk_osxapplication_add_app_menu_group (theApp);
 gtk_osxapplication_add_app_menu_item  (theApp, group,
                                        GTK_MENU_ITEM (preferences_item));
</programlisting>
</example>
Once we have everything set up for as many windows as we're going
to open before we call <link linkend="gtk-main-loop"><function>gtk_main_loop()</function></link>, we need to tell OSX that
we're ready:
<informalexample><programlisting>gtk_osxapplication_ready(theApp);</programlisting></informalexample>
</para>
<para>
If you add other windows later, you must do everything above for
each one's menubar. Most of the time the internal notifictations
will ensure that the GtkOSXApplication is able to keep everything
in sync. However, if you at any time disconnect or block signals
and change the menu (perhaps because of a context change within a
window, as with changing pages in a GtkNotebook) you need to call
<informalexample><programlisting>gtk_osxapplication_sync_menubar(theApp)</programlisting></informalexample>
</para>
<para>
* The dock is that bar of icons that normally lives at the bottom of
the display on a Mac (though it can be moved to one of the other
sides; this author likes his on the left, which is where it was
originally on a NeXT). Each running application has a "dock tile",
an icon on the dock. Users can, if they like, add application (or
document) icons to the dock, and those can be used to launch the
application. Apple allows limited customization of the dock tile,
and GtkOSXApplication has an interface for adding to the dock's
menu and for changing the icon that is displayed for the the
application. GtkOSXApplication also provides an interface to
AttentionRequest, which bounces the dock tile if the application
doesn't have focus. You might want to do that at the end of a long
task so that the user will know that it's finished if she's
switched to another application while she waits for yours.
They're all pretty simple, so you can just read the details below.
</para>
<para>
* The last feature to which GtkOSXApplication provides an interface
is the bundle. Normally in OSX, graphical applications are packaged
along with their non-standard dependencies and their resources
(graphical elements, translations, and such) in special directory
structures called "bundles". To easily package your Gtk+
application, have a look at gtk-mac-bundler, also available from
the Gtk-OSX project.
</para>
<para>
OSX provides a variety of functions pertaining to bundles, most of which are not likely to interest someone porting a Gtk+ application. GtkOSXApplication has wrapped a few that might be:
<itemizedlist>
<listitem><para><link linkend="gtk-osxapplication-get-bundle-path"><function>gtk_osxapplication_get_bundle_path()</function></link></para></listitem>
<listitem><para><link linkend="gtk-osxapplication-get-resource-path"><function>gtk_osxapplication_get_resource_path()</function></link></para></listitem>
<listitem><para><link linkend="gtk-osxapplication-get-executable-path"><function>gtk_osxapplication_get_executable_path()</function></link></para></listitem>
<listitem><para><link linkend="gtk-osxapplication-get-bundle-id"><function>gtk_osxapplication_get_bundle_id()</function></link></para></listitem>
<listitem><para><link linkend="gtk-osxapplication-get-bundle-info"><function>gtk_osxapplication_get_bundle_info()</function></link></para></listitem>
</itemizedlist>
</para>
<para>
The first three just get a UTF8-encoded path. An interesting note
is that they'll return the path to the executable or the folder
it's in regardless of whether it's actually in a bundle. To find
out if one is actually dealing with a bundle,
<link linkend="gtk-osxapplication-get-bundle-id"><function>gtk_osxapplication_get_bundle_id()</function></link> will return "" if it can't find
the key <link linkend="CFBundleIdentifier"><literal>CFBundleIdentifier</literal></link> from the bundle's Info.plist -- which it
won't if the application isn't in a bundle or wasn't launched by
opening the bundle. (In other words, even if you have your
application installed in Foo.app, if you launch it from the command
line as
<informalexample><programlisting>$ Foo.app/Contents/MacOS/Foo</programlisting></informalexample>
the Info.plist won't have been opened and
<link linkend="gtk-osxapplication-get-bundle-id"><function>gtk_osxapplication_get_bundle_id()</function></link> will return "". Of course, it
will also return "" if you didn't set <link linkend="CFBundleIdentifier"><literal>CFBundleIdentifier</literal></link> in the
Info.plist, so make sure that you do!
</para>
<para>
The last function, <link linkend="gtk-osxapplication-get-bundle-info"><function>gtk_osxapplication_get_bundle_info()</function></link>, will
return the value associated with an arbitrary key from Info.plist
as long as that value is a string. If it isn't, then the function
returns a null string ("").
</para>
<para>
Finally, notice the signals. These are emitted in response to the
indicated OSX notifications. Except for
<link linkend="GtkOSXApplication-NSApplicationBlockTermination"><type>"NSApplicationBlockTermination"</type></link>, most programs
won't need to do anything with
them. <link linkend="GtkOSXApplication-NSApplicationBlockTermination"><type>"NSApplicationBlockTermination"</type></link> is telling
you that OSX is planning to shut down your program. If you have any
cleanup to do (like saving open files), or if you want to ask the
user if it's OK, you should connect to the signal and do your
cleanup. Your handler can return <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to prevent the application
from quitting.</para>
<para>
</para>
</refsect1>

<refsect1 id="GtkOSXApplication.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkOSXApplicationPrivate" role="struct">
<title>GtkOSXApplicationPrivate</title>
<indexterm zone="GtkOSXApplicationPrivate"><primary sortas="GtkOSXApplicationPrivate">GtkOSXApplicationPrivate</primary></indexterm><programlisting>typedef struct _GtkOSXApplicationPrivate GtkOSXApplicationPrivate;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GtkOSXApplicationMenuGroup" role="struct">
<title>GtkOSXApplicationMenuGroup</title>
<indexterm zone="GtkOSXApplicationMenuGroup"><primary sortas="GtkOSXApplicationMenuGroup">GtkOSXApplicationMenuGroup</primary></indexterm><programlisting>typedef struct {
  GList *items;
} GtkOSXApplicationMenuGroup;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="GtkOSXApplication-struct" role="struct">
<title>GtkOSXApplication</title>
<indexterm zone="GtkOSXApplication-struct"><primary sortas="GtkOSXApplication">GtkOSXApplication</primary></indexterm><programlisting>typedef struct _GtkOSXApplication GtkOSXApplication;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-osxapplication-ready" role="function">
<title>gtk_osxapplication_ready ()</title>
<indexterm zone="gtk-osxapplication-ready"><primary sortas="gtk_osxapplication_ready">gtk_osxapplication_ready</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_ready            (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);</programlisting>
<para>
Inform Cocoa that application initialization is complete.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-cleanup" role="function">
<title>gtk_osxapplication_cleanup ()</title>
<indexterm zone="gtk-osxapplication-cleanup"><primary sortas="gtk_osxapplication_cleanup">gtk_osxapplication_cleanup</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_cleanup          (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);</programlisting>
<para>
Destroy the GtkOSXApplication object. Not normally needed, as the
object is expected to remain until the application quits, and this
function is called by the notification object at that time.  Menu
bars are released as the corresponding GtkMenuBars are destroyed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkApplication object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-use-quartz-accelerators" role="function">
<title>gtk_osxapplication_set_use_quartz_accelerators ()</title>
<indexterm zone="gtk-osxapplication-set-use-quartz-accelerators"><primary sortas="gtk_osxapplication_set_use_quartz_accelerators">gtk_osxapplication_set_use_quartz_accelerators</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_use_quartz_accelerators
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="gboolean">gboolean</link> use_quartz_accelerators);</programlisting>
<para>
Set quartz accelerator handling; TRUE (default) uses quartz; FALSE
uses Gtk+. Quartz accelerator handling is required for normal OSX
accelerators (e.g., command-q to quit) to work.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication pointer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>use_quartz_accelerators</parameter>&#160;:</term>
<listitem><simpara> Gboolean 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-use-quartz-accelerators" role="function">
<title>gtk_osxapplication_use_quartz_accelerators ()</title>
<indexterm zone="gtk-osxapplication-use-quartz-accelerators"><primary sortas="gtk_osxapplication_use_quartz_accelerators">gtk_osxapplication_use_quartz_accelerators</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_osxapplication_use_quartz_accelerators
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);</programlisting>
<para>
Are we using Quartz or Gtk+ accelerator handling?</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication pointer.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a gboolean
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-menu-bar" role="function">
<title>gtk_osxapplication_set_menu_bar ()</title>
<indexterm zone="gtk-osxapplication-set-menu-bar"><primary sortas="gtk_osxapplication_set_menu_bar">gtk_osxapplication_set_menu_bar</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_menu_bar     (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Set a window's menubar as the application menu bar. Call this once
for each window as you create them. It works best if the menubar is
reasonably fully populated before you call it. Once set, it will
stay syncronized through signals as long as you don't disconnect or
block them.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> The GtkMenuBar that you want to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-sync-menubar" role="function">
<title>gtk_osxapplication_sync_menubar ()</title>
<indexterm zone="gtk-osxapplication-sync-menubar"><primary sortas="gtk_osxapplication_sync_menubar">gtk_osxapplication_sync_menubar</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_sync_menubar     (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self);</programlisting>
<para>
Syncronize the active window's GtkMenuBar with the OSX menu
bar. You should only need this if you have programmatically changed
the menus with signals blocked or disconnected.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-insert-app-menu-item" role="function">
<title>gtk_osxapplication_insert_app_menu_item ()</title>
<indexterm zone="gtk-osxapplication-insert-app-menu-item"><primary sortas="gtk_osxapplication_insert_app_menu_item">gtk_osxapplication_insert_app_menu_item</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_insert_app_menu_item
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item,
                                                         <link linkend="gint">gint</link> index);</programlisting>
<para>
Certain menu items (About, Check for updates, and Preferences in
particular) are normally found in the so-called Application menu
(the first one on the menubar, named after the application) in OSX
applications. This function will create a menu entry for such a
menu item, removing it from its original menu in the Gtk
application.
</para>
<para>
To group your menu items, insert GtkSeparatorMenuItem*s where you want them.
</para>
<para>
Don't use it for Quit! A Quit menu item is created automatically
along with the Application menu. Just hide your Gtk Quit menu item.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> The GtkMenuItem to add to the group.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter>&#160;:</term>
<listitem><simpara> The place in the app menu that you want the item
inserted. The first item is 0.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-window-menu" role="function">
<title>gtk_osxapplication_set_window_menu ()</title>
<indexterm zone="gtk-osxapplication-set-window-menu"><primary sortas="gtk_osxapplication_set_window_menu">gtk_osxapplication_set_window_menu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_window_menu  (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Sets a designated menu item already on the menu bar as the Window
menu. This is the menu which contains a list of open windows for
the application; by default it also provides menu items to minimize
and zoom the current window and to bring all windows to the
front. Call this after <link linkend="gtk-osx-application-set-menu-bar"><function>gtk_osx_application_set_menu_bar()</function></link>. It
operates on the currently active menubar. If <parameter>nenu_item</parameter> is NULL, it
will create a new menu for you, which will not be gettext translatable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> The menu item which will be set as the Window menu
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-help-menu" role="function">
<title>gtk_osxapplication_set_help_menu ()</title>
<indexterm zone="gtk-osxapplication-set-help-menu"><primary sortas="gtk_osxapplication_set_help_menu">gtk_osxapplication_set_help_menu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_help_menu    (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Sets a designated menu item already on the menu bar as the Help
menu. Call this after <link linkend="gtk-osx-application-set-menu-bar"><function>gtk_osx_application_set_menu_bar()</function></link>, but
before <link linkend="gtk-osx-application-window-menu"><function>gtk_osx_application_window_menu()</function></link>, especially if you're
letting GtkOSXApplication create a Window menu for you (it helps
position the Window menu correctly). It operates on the currently
active menubar. If <parameter>nenu_item</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, it will create a new menu
for you, which will not be gettext translatable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> The menu item which will be set as the Window menu
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GtkOSXApplicationAttentionType" role="enum">
<title>enum GtkOSXApplicationAttentionType</title>
<indexterm zone="GtkOSXApplicationAttentionType"><primary sortas="GtkOSXApplicationAttentionType">GtkOSXApplicationAttentionType</primary></indexterm><programlisting>typedef enum {
  CRITICAL_REQUEST = 0,
  INFO_REQUEST = 10
} GtkOSXApplicationAttentionType;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="GTK-TYPE-OSX-APPLICATION-ATTENTION-TYPE--CAPS" role="macro">
<title>GTK_TYPE_OSX_APPLICATION_ATTENTION_TYPE</title>
<indexterm zone="GTK-TYPE-OSX-APPLICATION-ATTENTION-TYPE--CAPS"><primary sortas="GTK_TYPE_OSX_APPLICATION_ATTENTION_TYPE">GTK_TYPE_OSX_APPLICATION_ATTENTION_TYPE</primary></indexterm><programlisting>#define GTK_TYPE_OSX_APPLICATION_ATTENTION_TYPE	(gtk_type_osxapplication_attention_type_get_type())
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-type-osxapplication-attention-type-get-type" role="function">
<title>gtk_type_osxapplication_attention_type_get_type ()</title>
<indexterm zone="gtk-type-osxapplication-attention-type-get-type"><primary sortas="gtk_type_osxapplication_attention_type_get_type">gtk_type_osxapplication_attention_type_get_type</primary></indexterm><programlisting><link linkend="GType">GType</link>               gtk_type_osxapplication_attention_type_get_type
                                                        (void);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-dock-menu" role="function">
<title>gtk_osxapplication_set_dock_menu ()</title>
<indexterm zone="gtk-osxapplication-set-dock-menu"><primary sortas="gtk_osxapplication_set_dock_menu">gtk_osxapplication_set_dock_menu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_dock_menu    (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Set a GtkMenu as the dock menu.  
</para>
<para>
This menu does not have a "sync" function, so changes made while
signals are disconnected will not update the menu which appears in
the dock, and may produce strange results or crashes if a
GtkMenuItem or GtkAction associated with a dock menu item is
deallocated.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> A GtkMenu (cast it with <link linkend="GTK-MENU-SHELL--CAPS"><function>GTK_MENU_SHELL()</function></link> when you
pass it in
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-dock-icon-pixbuf" role="function">
<title>gtk_osxapplication_set_dock_icon_pixbuf ()</title>
<indexterm zone="gtk-osxapplication-set-dock-icon-pixbuf"><primary sortas="gtk_osxapplication_set_dock_icon_pixbuf">gtk_osxapplication_set_dock_icon_pixbuf</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_dock_icon_pixbuf
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Set the dock icon from a GdkPixbuf</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pixbuf</parameter>&#160;:</term>
<listitem><simpara> The pixbuf. Pass NULL to reset the icon to its default.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-set-dock-icon-resource" role="function">
<title>gtk_osxapplication_set_dock_icon_resource ()</title>
<indexterm zone="gtk-osxapplication-set-dock-icon-resource"><primary sortas="gtk_osxapplication_set_dock_icon_resource">gtk_osxapplication_set_dock_icon_resource</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_set_dock_icon_resource
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *type,
                                                         const <link linkend="gchar">gchar</link> *subdir);</programlisting>
<para>
Set the dock icon from an image file in the bundle/</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> The ame of the image file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara> The extension (e.g., jpg) of the filename
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subdir</parameter>&#160;:</term>
<listitem><simpara> The subdirectory of $Bundle/Contents/Resources in which to
look for the file.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-attention-request" role="function">
<title>gtk_osxapplication_attention_request ()</title>
<indexterm zone="gtk-osxapplication-attention-request"><primary sortas="gtk_osxapplication_attention_request">gtk_osxapplication_attention_request</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_osxapplication_attention_request
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="GtkOSXApplicationAttentionType">GtkOSXApplicationAttentionType</link> type);</programlisting>
<para>
Create an attention request.  If type is CRITICAL_REQUEST, the
dock icon will bounce until cancelled the application receives
focus; otherwise it will bounce for 1 second -- but the attention
request will remain asserted until cancelled or the application
receives focus. This function has no effect if the application has focus.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The GtkOSXApplication pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara> CRITICAL_REQUEST or INFO_REQUEST
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A the attention request ID. Pass this id to
gtk_osxapplication_cancel_attention_request.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-osxapplication-cancel-attention-request" role="function">
<title>gtk_osxapplication_cancel_attention_request ()</title>
<indexterm zone="gtk-osxapplication-cancel-attention-request"><primary sortas="gtk_osxapplication_cancel_attention_request">gtk_osxapplication_cancel_attention_request</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_osxapplication_cancel_attention_request
                                                        (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *self,
                                                         <link linkend="gint">gint</link> id);</programlisting>
<para>
Cancel an attention request created with
gtk_osxapplication_attention_request.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara> The application
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>id</parameter>&#160;:</term>
<listitem><simpara> The integer attention request id returned from
gtk_osxapplication_attention_request.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="quartz-application-get-bundle-path" role="function">
<title>quartz_application_get_bundle_path ()</title>
<indexterm zone="quartz-application-get-bundle-path"><primary sortas="quartz_application_get_bundle_path">quartz_application_get_bundle_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             quartz_application_get_bundle_path  (void);</programlisting>
<para>
Return the root path of the bundle or the directory containing the
 executable if it isn't actually a bundle.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> path The bundle's absolute path or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error. <link linkend="g-free"><function>g_free()</function></link> it when done.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="quartz-application-get-resource-path" role="function">
<title>quartz_application_get_resource_path ()</title>
<indexterm zone="quartz-application-get-resource-path"><primary sortas="quartz_application_get_resource_path">quartz_application_get_resource_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             quartz_application_get_resource_path
                                                        (void);</programlisting>
<para>
Return the Resource path for the bundle or the directory containing the
 executable if it isn't actually a bundle. Use <link linkend="quartz-application-get-bundle-id"><function>quartz_application_get_bundle_id()</function></link> to check (it will return <link linkend="NULL--CAPS"><literal>NULL</literal></link> if it's not a bundle).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> path The absolute resource path. or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error. <link linkend="g-free"><function>g_free()</function></link> it when done.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="quartz-application-get-executable-path" role="function">
<title>quartz_application_get_executable_path ()</title>
<indexterm zone="quartz-application-get-executable-path"><primary sortas="quartz_application_get_executable_path">quartz_application_get_executable_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             quartz_application_get_executable_path
                                                        (void);</programlisting>
<para>
Return the executable path, including file name</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The path to the primary executable, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if it can't find one. <link linkend="g-free"><function>g_free()</function></link> it when done
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="quartz-application-get-bundle-id" role="function">
<title>quartz_application_get_bundle_id ()</title>
<indexterm zone="quartz-application-get-bundle-id"><primary sortas="quartz_application_get_bundle_id">quartz_application_get_bundle_id</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             quartz_application_get_bundle_id    (void);</programlisting>
<para>
Return the value of the CFBundleIdentifier key from the bundle's Info.plist
</para>
<para>
This will return NULL if it's not really a bundle, there's no
Info.plist, or if Info.plist doesn't have a CFBundleIdentifier key
(So if you need to detect being in a bundle, make sure that your
bundle has that key!)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The string value of CFBundleIdentifier, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if there is none. <link linkend="g-free"><function>g_free()</function></link> it when done.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="quartz-application-get-bundle-info" role="function">
<title>quartz_application_get_bundle_info ()</title>
<indexterm zone="quartz-application-get-bundle-info"><primary sortas="quartz_application_get_bundle_info">quartz_application_get_bundle_info</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             quartz_application_get_bundle_info  (const <link linkend="gchar">gchar</link> *key);</programlisting>
<para>
Queries the bundle's Info.plist with key. If the returned object is
a string, returns that; otherwise returns <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara> The key, as a normal UTF8 string.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A UTF8-encoded string. <link linkend="g-free"><function>g_free()</function></link> it when done.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

<refsect1 id="GtkOSXApplication.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkOSXApplication-NSApplicationBlockTermination" role="signal"><title>The <literal>&quot;NSApplicationBlockTermination&quot;</literal> signal</title>
<indexterm zone="GtkOSXApplication-NSApplicationBlockTermination"><primary sortas="GtkOSXApplication::NSApplicationBlockTermination">GtkOSXApplication::NSApplicationBlockTermination</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            user_function                      (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *app,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : No Recursion / Action</programlisting>
<para>
Emitted by the Application Delegate when the application reeeives
an NSApplicationShouldTerminate notification. Perform any cleanup
you need to do (e.g., saving files) before exiting. Returning FALSE
will allow further handlers to run and if none return TRUE, the
application to shut down. Returning TRUE will veto shutdown and
stop emission, so later handlers will not run.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>app</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> Data appended at connection
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Boolean indicating that further emission and application
termination should be blocked.
</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkOSXApplication-NSApplicationDidBecomeActive" role="signal"><title>The <literal>&quot;NSApplicationDidBecomeActive&quot;</literal> signal</title>
<indexterm zone="GtkOSXApplication-NSApplicationDidBecomeActive"><primary sortas="GtkOSXApplication::NSApplicationDidBecomeActive">GtkOSXApplication::NSApplicationDidBecomeActive</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *app,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : No Recursion / Action</programlisting>
<para>
Emitted by the Application Delegate when the application receives
an NSApplicationDidBecomeActive notification. Connect a handler if
there is anything you need to do when the application is activated.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>app</parameter>&#160;:</term>
<listitem><simpara> The application object
<link linkend="user-data--"><type>""</type></link> Data appended at connection
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkOSXApplication-NSApplicationOpenFile" role="signal"><title>The <literal>&quot;NSApplicationOpenFile&quot;</literal> signal</title>
<indexterm zone="GtkOSXApplication-NSApplicationOpenFile"><primary sortas="GtkOSXApplication::NSApplicationOpenFile">GtkOSXApplication::NSApplicationOpenFile</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            user_function                      (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *app,
                                                        <link linkend="gchar">gchar</link>             *path,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : No Recursion / Action</programlisting>
<para>
Emitted when a OpenFile, OpenFiles, or OpenEmptyFile event is
received from the operating system. This signal does not implement
drops, but it does implement "open with" events from Finder. An
OpenEmptyFile is received at launch in Python applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>app</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara> A UTF8-encoded file path to open.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> Data attached at connection
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Boolean indicating success at opening the file.
</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkOSXApplication-NSApplicationWillResignActive" role="signal"><title>The <literal>&quot;NSApplicationWillResignActive&quot;</literal> signal</title>
<indexterm zone="GtkOSXApplication-NSApplicationWillResignActive"><primary sortas="GtkOSXApplication::NSApplicationWillResignActive">GtkOSXApplication::NSApplicationWillResignActive</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *app,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : No Recursion / Action</programlisting>
<para>
This signal is emitted by the Application Delegate when the
application receives an NSApplicationWillResignActive
notification. Connect a handler to it if there's anything your
application needs to do to prepare for inactivity.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>app</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> Data appended at connection
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkOSXApplication-NSApplicationWillTerminate" role="signal"><title>The <literal>&quot;NSApplicationWillTerminate&quot;</literal> signal</title>
<indexterm zone="GtkOSXApplication-NSApplicationWillTerminate"><primary sortas="GtkOSXApplication::NSApplicationWillTerminate">GtkOSXApplication::NSApplicationWillTerminate</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkOSXApplication">GtkOSXApplication</link> *app,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : No Recursion / Action</programlisting>
<para>
Emitted by the Application Delegate when the application reeeives
an NSApplicationSWillTerminate notification. Connect your final
shutdown routine (the one that calls <link linkend="gtk-main-quit"><function>gtk_main_quit()</function></link> here.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>app</parameter>&#160;:</term>
<listitem><simpara> The application object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> Data appended at connection
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
