Class DrawingArea.Builder<B extends DrawingArea.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
DrawingArea

public static class DrawingArea.Builder<B extends DrawingArea.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public DrawingArea build()
      Finish building the DrawingArea object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to DrawingArea.
      Overrides:
      build in class Widget.Builder<B extends DrawingArea.Builder<B>>
      Returns:
      a new instance of DrawingArea with the properties that were set in the Builder object.
    • setContentHeight

      public B setContentHeight(int contentHeight)
      The content height.
      Parameters:
      contentHeight - the value for the content-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setContentWidth

      public B setContentWidth(int contentWidth)
      The content width.
      Parameters:
      contentWidth - the value for the content-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onResize

      public B onResize(DrawingArea.ResizeCallback handler)

      Emitted once when the widget is realized, and then each time the widget is changed while realized.

      This is useful in order to keep state up to date with the widget size, like for instance a backing surface.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: