Top | ![]() |
![]() |
![]() |
![]() |
RBPropertyViewRBPropertyView — a GtkTreeView backed by a RhythmDBPropertyModel |
RhythmDB * | db | Read / Write / Construct Only |
gboolean | draggable | Read / Write / Construct Only |
RhythmDBPropType | prop | Read / Write / Construct Only |
RhythmDBPropertyModel * | property-model | Read / Write |
gchar * | title | Read / Write / Construct Only |
void | properties-selected | Run Last |
void | property-activated | Run Last |
void | property-selected | Run Last |
void | property-selection-reset | Run Last |
void | show-popup | Run Last |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkScrolledWindow ╰── RBPropertyView
A simple GtkTreeView that displays the contents of a RhythmDBPropertyModel. The first row in the tree view displays the total number of properties and entries, in the form "All 473 artists (6241)". Each subsequent row in the tree view displays a property value and the number of entries from the RhythmDBQueryModel with that value.
The property view itself creates a single column, but additional columns can be added.
RBPropertyView * rb_property_view_new (RhythmDB *db
,guint propid
,const char *title
);
Creates a new RBPropertyView displaying the specified property.
db |
RhythmDB instance |
|
propid |
property ID to be displayed in the property view |
|
title |
title of the property view |
void rb_property_view_append_column_custom (RBPropertyView *view
,GtkTreeViewColumn *column
);
Appends a custom created column to the view.
void rb_property_view_set_selection_mode (RBPropertyView *view
,GtkSelectionMode mode
);
Sets the selection mode (single or multiple) for the property view> The default selection mode is single.
void
rb_property_view_reset (RBPropertyView *view
);
Clears the selection in the property view.
void rb_property_view_set_selection (RBPropertyView *view
,const GList *vals
);
Replaces the selection in the property view. All values in the list that are present in the view will be selected, and the view will be scrolled to show the last value selected.
GList *
rb_property_view_get_selection (RBPropertyView *view
);
Returns a GList containing the selected property values. The list must be freed by the caller.
RhythmDBPropertyModel *
rb_property_view_get_model (RBPropertyView *view
);
Returns the RhythmDBPropertyModel backing the view; no reference is taken
void rb_property_view_set_model (RBPropertyView *view
,RhythmDBPropertyModel *model
);
Replaces the model backing the property view.
guint
rb_property_view_get_num_properties (RBPropertyView *view
);
Returns the number of property values present in the view.
void rb_property_view_set_search_func (RBPropertyView *view
,GtkTreeViewSearchEqualFunc func
,gpointer func_data
,GDestroyNotify notify
);
Sets the compare function for the interactive search capabilities. The function must return FALSE when the search key string matches the row it is passed.
struct RBPropertyViewClass { GtkScrolledWindowClass parent; void (*property_selected) (RBPropertyView *view, const char *name); void (*properties_selected) (RBPropertyView *view, GList *properties); void (*property_activated) (RBPropertyView *view, const char *name); void (*selection_reset) (RBPropertyView *view); void (*show_popup) (RBPropertyView *view); };
“draggable”
property“draggable” gboolean
Whether the property view acts as a data source for drag and drop operations.
Flags: Read / Write / Construct Only
Default value: TRUE
“prop”
property“prop” RhythmDBPropType
The property that is displayed in this view
Flags: Read / Write / Construct Only
Default value: RHYTHMDB_PROP_TYPE
“property-model”
property“property-model” RhythmDBPropertyModel *
The RhythmDBPropertyModel backing the view.
Flags: Read / Write
“title”
property“title” gchar *
The title displayed in the header of the property view
Flags: Read / Write / Construct Only
Default value: ""
“properties-selected”
signalvoid user_function (RBPropertyView *view, gpointer properties, gpointer user_data)
Emitted when the set of selected property values changes. This is only emitted for multiple selection property views. For single-selection views, use the property-selected signal.
view |
the RBPropertyView |
|
properties |
a list containing the selected property values. |
[element-type utf8] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“property-activated”
signalvoid user_function (RBPropertyView *view, gchar *name, gpointer user_data)
Emitted when a row in a property view is activated by double clicking.
view |
the RBPropertyView |
|
name |
the property value that was activated |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“property-selected”
signalvoid user_function (RBPropertyView *view, gchar *name, gpointer user_data)
Emitted when an individual property value becomes selected. This is only emitted for single-selection property views. For multiple-selection views, use the properties-selected signal.
view |
the RBPropertyView |
|
name |
the property value that has been selected |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“property-selection-reset”
signalvoid user_function (RBPropertyView *view, gpointer user_data)
Emitted when the selection is reset. At this point, no property values are selected.
Flags: Run Last
“show-popup”
signalvoid user_function (RBPropertyView *view, gpointer user_data)
Emitted when a popup menu should be displayed for the property view. The source containing the property view should connect a handler to this signal that * displays an appropriate popup.
Flags: Run Last