package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Application_Window_Record, Gtk_Application_Window);
package Implements_Gaction_Group is new Glib.Types.Implements (Glib.Action_Group.Gaction_Group, Gtk_Application_Window_Record, Gtk_Application_Window);
package Implements_Gaction_Map is new Glib.Types.Implements (Glib.Action_Map.Gaction_Map, Gtk_Application_Window_Record, Gtk_Application_Window);
type Gtk_Application_Window_Record is new Gtk_Window_Record with null record;
type Gtk_Application_Window is access all Gtk_Application_Window_Record'Class;
Show_Menubar_Property : constant Glib.Properties.Property_Boolean;
procedure Gtk_New
( | Self | : out Gtk_Application_Window; |
Application | : not null access Gtk.Application.Gtk_Application_Record'Class); |
procedure Initialize
( | Self | : not null access Gtk_Application_Window_Record'Class; |
Application | : not null access Gtk.Application.Gtk_Application_Record'Class); |
function Gtk_Application_Window_New
( | Application | : not null access Gtk.Application.Gtk_Application_Record'Class) return Gtk_Application_Window; |
function Get_Type return Glib.GType;
function Get_Id
( | Self | : not null access Gtk_Application_Window_Record) return Guint; |
function Get_Show_Menubar
( | Self | : not null access Gtk_Application_Window_Record) return Boolean; |
procedure Set_Show_Menubar
( | Self | : not null access Gtk_Application_Window_Record; |
Show_Menubar | : Boolean); |
procedure Action_Added
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String); |
procedure Action_Enabled_Changed
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String; | |
Enabled | : Boolean); |
procedure Action_Removed
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String); |
procedure Action_State_Changed
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String; | |
State | : Glib.Variant.Gvariant); |
procedure Activate_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String; | |
Parameter | : Glib.Variant.Gvariant); |
procedure Change_Action_State
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String; | |
Value | : Glib.Variant.Gvariant); |
function Get_Action_Enabled
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Boolean; |
function Get_Action_Parameter_Type
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant_Type; |
function Get_Action_State
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant; |
function Get_Action_State_Hint
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant; |
function Get_Action_State_Type
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant_Type; |
function Has_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Boolean; |
function List_Actions
( | Self | : not null access Gtk_Application_Window_Record) return GNAT.Strings.String_List; |
function Query_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String; | |
Enabled | : access Boolean; | |
Parameter_Type | : access Glib.Variant.Gvariant_Type; | |
State_Type | : access Glib.Variant.Gvariant_Type; | |
State_Hint | : access Glib.Variant.Gvariant; | |
State | : access Glib.Variant.Gvariant) return Boolean; |
procedure Add_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action | : Glib.Action.Gaction); |
procedure Add_Action_Entries
( | Self | : not null access Gtk_Application_Window_Record; |
Entries | : GAction_Entry_Array; | |
User_Data | : System.Address := System.Null_Address); |
function Lookup_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String) return Glib.Action.Gaction; |
procedure Remove_Action
( | Self | : not null access Gtk_Application_Window_Record; |
Action_Name | : UTF8_String); |
function "+"
( | Widget | : access Gtk_Application_Window_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Application_Window renames Implements_Gtk_Buildable.To_Object; |
function "+"
( | Widget | : access Gtk_Application_Window_Record'Class) return Glib.Action_Group.Gaction_Group renames Implements_Gaction_Group.To_Interface; |
function "-"
( | Interf | : Glib.Action_Group.Gaction_Group) return Gtk_Application_Window renames Implements_Gaction_Group.To_Object; |
function "+"
( | Widget | : access Gtk_Application_Window_Record'Class) return Glib.Action_Map.Gaction_Map renames Implements_Gaction_Map.To_Interface; |
function "-"
( | Interf | : Glib.Action_Map.Gaction_Map) return Gtk_Application_Window renames Implements_Gaction_Map.To_Object; |
GtkApplicationWindow is a Gtk.Window.Gtk_Window subclass that offers some extra functionality for better integration with Gtk.Application.Gtk_Application features. Notably, it can handle both the application menu as well as the menubar. See Gtk.Application.Set_App_Menu and Gtk.Application.Set_Menubar.
This class implements the Glib.Action_Group.Gaction_Group and Glib.Action_Map.Gaction_Map interfaces, to let you add window-specific actions that will be exported by the associated Gtk.Application.Gtk_Application, together with its application-wide actions. Window-specific actions are prefixed with the "win." prefix and application-wide actions are prefixed with the "app." prefix. Actions must be addressed with the prefixed name when referring to them from a Glib.Menu_Model.Gmenu_Model.
Note that widgets that are placed inside a GtkApplicationWindow can also activate these actions, if they implement the GtkActionable interface.
As with Gtk.Application.Gtk_Application, the GDK lock will be acquired when processing actions arriving from other processes and should therefore be held when activating actions locally (if GDK threads are enabled).
The settings Gtk.Settings.Gtk_Settings:gtk-shell-shows-app-menu and Gtk.Settings.Gtk_Settings:gtk-shell-shows-menubar tell GTK+ whether the desktop environment is showing the application menu and menubar models outside the application as part of the desktop shell. For instance, on OS X, both menus will be displayed remotely; on Windows neither will be. gnome-shell (starting with version 3.4) will display the application menu, but not the menubar.
If the desktop environment does not display the menubar, then Gtk.Application_Window.Gtk_Application_Window will automatically show a Gtk.Menu_Bar.Gtk_Menu_Bar for it. (see the Gtk.Application.Gtk_Application docs for some screenshots of how this looks on different platforms). This behaviour can be overridden with the Gtk.Application_Window.Gtk_Application_Window:show-menubar property. If the desktop environment does not display the application menu, then it will automatically be included in the menubar. == A GtkApplicationWindow with a menubar == app = gtk_application_new (); builder = gtk_builder_new (); gtk_builder_add_from_string (builder, "<interface>" " <menu id='menubar'>" " <submenu label='_Edit'>" " <item label='_Copy' action='win.copy'/>" " <item label='_Paste' action='win.paste'/>" " </submenu>" " </menu>" "</interface>"); gtk_application_set_menubar (G_APPLICATION (app), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"))); g_object_unref (builder); ... window = gtk_application_window_new (app); == Handling fallback yourself == <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/sunny.c"> <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> </xi:include> The XML format understood by Gtk.Builder.Gtk_Builder for Glib.Menu_Model.Gmenu_Model consists of a toplevel <tag class="starttag">menu</tag> element, which contains one or more <tag class="starttag">item</tag> elements. Each <tag class="starttag">item</tag> element contains <tag class="starttag">attribute</tag> and <tag class="starttag">link</tag> elements with a mandatory name attribute. <tag class="starttag">link</tag> elements have the same content model as <tag class="starttag">menu</tag>.
Attribute values can be translated using gettext, like other Gtk.Builder.Gtk_Builder content. <tag class="starttag">attribute</tag> elements can be marked for translation with a 'translatable="yes"' attribute. It is also possible to specify message context and translator comments, using the context and comments attributes. To make use of this, the Gtk.Builder.Gtk_Builder must have been given the gettext domain to use.