Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_widget_get_child_by_label ( CameraWidget widget,
const char *  label,
CameraWidget **  child 

Retrieves the child with label label of the CameraWidget.

widget a CameraWidget
label the label of the child
a gphoto2 error code.

Definition at line 531 of file gphoto2-widget.c.

References CHECK_NULL, _CameraWidget::children, _CameraWidget::children_count, GP_ERROR_BAD_PARAMETERS, GP_OK, gp_widget_get_child_by_label(), and _CameraWidget::label.

Referenced by gp_widget_get_child_by_label().

      int x;

      CHECK_NULL (widget && label && child);

      if (strcmp (widget->label, label) == 0) {
            *child = widget;
            return (GP_OK);

      for (x = 0; x < widget->children_count; x++) {
            int result;
            CameraWidget *child_rec;
            result = gp_widget_get_child_by_label (widget->children[x], 
                                           label, &child_rec);
            if (result == GP_OK) {
                  *child = child_rec;
                  return (GP_OK);


Generated by  Doxygen 1.6.0   Back to index