Class ApplicationWindow

All Implemented Interfaces:
ActionGroup, ActionMap, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, Proxy

@Generated("org.javagi.JavaGI") public class ApplicationWindow extends ApplicationWindow implements ActionGroup, ActionMap, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager

A freeform application window.

application-window

AdwApplicationWindow is a ApplicationWindow subclass providing the same features as Window.

See Window for details.

Example of an AdwApplicationWindow UI definition:

<object class="AdwApplicationWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar"/>
      </child>
      <property name="content">
        <!-- ... -->
      </property>
    </object>
  </property>
</object>

Using Gtk.Application:menubar is not supported and may result in visual glitches.

  • Constructor Details

    • ApplicationWindow

      public ApplicationWindow(MemorySegment address)
      Create a ApplicationWindow instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ApplicationWindow

      public ApplicationWindow(Application app)
      Creates a new AdwApplicationWindow for app.
      Parameters:
      app - an application instance
    • ApplicationWindow

      public ApplicationWindow()
      Create a new ApplicationWindow.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ApplicationWindow class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected ApplicationWindow asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class ApplicationWindow
      Returns:
      the instance as if it were its parent type
    • addBreakpoint

      public void addBreakpoint(Breakpoint breakpoint)
      Adds breakpoint to self.
      Parameters:
      breakpoint - the breakpoint to add
      Since:
      1.4
    • getAdaptivePreview

      public boolean getAdaptivePreview()
      Gets whether adaptive preview for this ApplicationWindow is currently open.
      Returns:
      whether adaptive preview is open.
      Since:
      1.7
    • getContent

      public @Nullable Widget getContent()

      Gets the content widget of self.

      This method should always be used instead of Window#getChild.

      Returns:
      the content widget of this ApplicationWindow
    • getCurrentBreakpoint

      public @Nullable Breakpoint getCurrentBreakpoint()
      Gets the current breakpoint.
      Returns:
      the current breakpoint
      Since:
      1.4
    • getDialogs

      public ListModel getDialogs()

      Returns a ListModel that contains the open dialogs of self.

      This can be used to keep an up-to-date view.

      Returns:
      a list model for the dialogs of this ApplicationWindow
      Since:
      1.5
    • getVisibleDialog

      public @Nullable Dialog getVisibleDialog()
      Returns the currently visible dialog in self, if there's one.
      Returns:
      the visible dialog
      Since:
      1.5
    • setAdaptivePreview

      public void setAdaptivePreview(boolean adaptivePreview)

      Sets whether adaptive preview for this ApplicationWindow is currently open.

      Adaptive preview is a debugging tool used for testing the window contents at specific screen sizes, simulating mobile environment.

      Adaptive preview can always be accessed from inspector. This function allows applications to open it manually.

      Most applications should not use this function.

      Parameters:
      adaptivePreview - whether to open adaptive preview
      Since:
      1.7
    • setContent

      public void setContent(@Nullable Widget content)

      Sets the content widget of self.

      This method should always be used instead of Window#setChild.

      Parameters:
      content - the content widget
    • builder

      public static ApplicationWindow.Builder<? extends ApplicationWindow.Builder> builder()
      A ApplicationWindow.Builder object constructs a ApplicationWindow with the specified properties. Use the various set...() methods to set properties, and finish construction with ApplicationWindow.Builder.build().
      Returns:
      the builder object