Function

GimpUiprop_chooser_factory

Declaration [src]

GtkWidget*
gimp_prop_chooser_factory (
  GimpResourceWidgetCreator widget_creator_func,
  GObject* config,
  const gchar* property_name,
  const gchar* chooser_title
)

Description [src]

Creates a GimpResourceSelectButton that displays and sets the named property of the config.

The factory makes many kinds of widgets. Parameterized by passing a creator function for a kind of widget. E.G. creator function is gimp_brush_select_button_new. The created widget must have a property named “resource”.

The factory wraps the widget so that it is a prop widget. A prop widget gets the initial choice from the config and binds the property named property_name of the config to the widget’s “resource” property.

config is usually a GimpProcedureConfig (but it could be otherwise.) The config must have a property with name property_name. The property must be of type that matches that of the widget_creator_func, e.g. GimpBrush. The property_name need not be “brush”, since the config may have more than one property of the same type e.g. GimpBrush.

Available since:3.0
This function is not directly available to language bindings

Parameters

widget_creator_func GimpResourceWidgetCreator
 

Function that creates a chooser widget.

config GObject
 

Object to which property is attached.

 The data is owned by the caller of the function.
property_name const gchar*
 

Name of property set by the widget.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
chooser_title const gchar*
 

Title for the popup chooser dialog.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.

Return value

Returns: GtkWidget
 

The newly created GimpResourceSelectButton widget.

 The caller of the function takes ownership of the data, and is responsible for freeing it.