Package: gtk
Class gtk:application-window
Superclassesgtk:window, gtk:widget, gobject:initially-unowned, gio:action-group, gio:action-map, gtk:accessible, gtk:buildable, gtk:constraint-target, gtk:native, gtk:root, gtk:shortcut-manager, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:application-window class is a gtk:window subclass
that offers some extra functionality for better integration with gtk:application features.
Notably, it can handle an application menubar. This class implements the g:action-group and g:action-map interfaces, to let you add window specific actions that will be exported by the associated gtk:application instance, 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 g:menu-model object. Note that widgets that are placed inside an application window can also activate these actions, if they implement the gtk:actionable interface. The gtk-shell-shows-app-menu and gtk-shell-shows-menubar settings 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. If the desktop environment does not display the menubar, then the application window will automatically show a menubar for it. This behaviour can be overridden with the show-menubar property. If the desktop environment does not display the application menu, then it will automatically be included in the menubar or in the windows client-side decorations. See the gtk:popover-menu documentation for information about the XML language used by the gtk:builder object for menu models. Examples(defun do-application-window (&optional application) (let ((menus "<interface> <menu id='menubar'> <submenu> <attribute name='label'>_Edit</attribute> <item> <attribute name='label'>_Copy</attribute> <attribute name='action'>win.copy</attribute> </item> <item> <attribute name='label'>_Paste</attribute> <attribute name='action'>win.paste</attribute> </item> </submenu> </menu> </interface>") (builder (make-instance 'gtk:builder)) (window (make-instance 'gtk:application-window :application application :title "Application Window" :show-menubar t))) ;; Read the menus from a string (gtk:builder-add-from-string builder menus) ;; Set the menubar (setf (gtk:application-menubar application) (gtk:builder-object builder "menubar")) ;; Present the application window (gtk:window-present window))) | Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |
2024-10-7