Class CellRenderer.Builder<B extends CellRenderer.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
CellRendererPixbuf.Builder, CellRendererProgress.Builder, CellRendererSpinner.Builder, CellRendererText.Builder, CellRendererToggle.Builder
Enclosing class:
CellRenderer

public static class CellRenderer.Builder<B extends CellRenderer.Builder<B>> extends InitiallyUnowned.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 CellRenderer build()
      Finish building the CellRenderer object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to CellRenderer.
      Overrides:
      build in class InitiallyUnowned.Builder<B extends CellRenderer.Builder<B>>
      Returns:
      a new instance of CellRenderer with the properties that were set in the Builder object.
    • setCellBackground

      public B setCellBackground(String cellBackground)
    • setCellBackgroundRgba

      public B setCellBackgroundRgba(RGBA cellBackgroundRgba)
      Cell background as a GdkRGBA
      Parameters:
      cellBackgroundRgba - the value for the cell-background-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setCellBackgroundSet

      public B setCellBackgroundSet(boolean cellBackgroundSet)
    • setHeight

      public B setHeight(int height)
    • setIsExpanded

      public B setIsExpanded(boolean isExpanded)
    • setIsExpander

      public B setIsExpander(boolean isExpander)
    • setMode

      public B setMode(CellRendererMode mode)
    • setSensitive

      public B setSensitive(boolean sensitive)
    • setVisible

      public B setVisible(boolean visible)
    • setWidth

      public B setWidth(int width)
    • setXalign

      public B setXalign(float xalign)
    • setXpad

      public B setXpad(int xpad)
    • setYalign

      public B setYalign(float yalign)
    • setYpad

      public B setYpad(int ypad)
    • onEditingCanceled

      public B onEditingCanceled(CellRenderer.EditingCanceledCallback handler)

      This signal gets emitted when the user cancels the process of editing a cell. For example, an editable cell renderer could be written to cancel editing when the user presses Escape.

      See also: gtk_cell_renderer_stop_editing().

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

      public B onEditingStarted(CellRenderer.EditingStartedCallback handler)

      This signal gets emitted when a cell starts to be edited. The intended use of this signal is to do special setup on editable, e.g. adding a GtkEntryCompletion or setting up additional columns in a GtkComboBox.

      See gtk_cell_editable_start_editing() for information on the lifecycle of the editable and a way to do setup that doesn’t depend on the renderer.

      Note that GTK doesn't guarantee that cell renderers will continue to use the same kind of widget for editing in future releases, therefore you should check the type of editable before doing any specific setup, as in the following example:

      static void
      text_editing_started (GtkCellRenderer *cell,
                            GtkCellEditable *editable,
                            const char      *path,
                            gpointer         data)
      {
        if (GTK_IS_ENTRY (editable))
          {
            GtkEntry *entry = GTK_ENTRY (editable);
      
            // ... create a GtkEntryCompletion
      
            gtk_entry_set_completion (entry, completion);
          }
      }
      
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: