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

int gp_widget_get_choice ( CameraWidget widget,
int  choice_number,
const char **  choice 
)

Retrieves the choice number choice_number.

Parameters:
widget a CameraWidget of type GP_WIDGET_RADIO or GP_WIDGET_MENU
choice_number 
choice 
Returns:
a gphoto2 error code

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

References CHECK_NULL, _CameraWidget::choice, _CameraWidget::choice_count, GP_ERROR_BAD_PARAMETERS, GP_OK, GP_WIDGET_MENU, GP_WIDGET_RADIO, and _CameraWidget::type.

{
      CHECK_NULL (widget && choice);
      if ((widget->type != GP_WIDGET_RADIO) &&
          (widget->type != GP_WIDGET_MENU))
            return (GP_ERROR_BAD_PARAMETERS);

      if (choice_number >= widget->choice_count)
            return (GP_ERROR_BAD_PARAMETERS);

      *choice = widget->choice[choice_number];
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index