Exemplo n.º 1
0
static int colpal_init_proc(GtkWidget* w, GlowCtx* fctx, void* client_data)
{
  colpalwidget_sScroll* scroll_data;
  ColPalCtx* ctx;

  ctx = (ColPalCtx*)((ColPalWidgetGtk*)w)->colpal_ctx;

  if (((ColPalWidgetGtk*)w)->scroll_h) {
    scroll_data = (colpalwidget_sScroll*)malloc(sizeof(colpalwidget_sScroll));
    scroll_data->colpal = w;
    scroll_data->scroll_h = ((ColPalWidgetGtk*)w)->scroll_h;
    scroll_data->scroll_v = ((ColPalWidgetGtk*)w)->scroll_v;
    scroll_data->form = ((ColPalWidgetGtk*)w)->form;
    scroll_data->scroll_h_managed = 1;
    scroll_data->scroll_v_managed = 1;

    ctx->register_scroll_callback((void*)scroll_data, scroll_callback);
  }

  ctx->configure();

  if (((ColPalWidgetGtk*)w)->init_proc)
    return (((ColPalWidgetGtk*)w)->init_proc)(ctx, client_data);
  else
    return 1;
}
static int colpal_init_proc( Widget w, GlowCtx *fctx, void *client_data)
{
  colpalwidget_sScroll *scroll_data;
  ColPalCtx	*ctx;

  scroll_data = (colpalwidget_sScroll *) malloc( sizeof( colpalwidget_sScroll));
  scroll_data->colpal = w;
  scroll_data->scroll_h = ((ColPalWidget) w)->colpal.scroll_h;
  scroll_data->scroll_v = ((ColPalWidget) w)->colpal.scroll_v;
  scroll_data->form = ((ColPalWidget) w)->colpal.form;
  scroll_data->scroll_h_managed = 1;
  scroll_data->scroll_v_managed = 1;

  ctx = (ColPalCtx *) ((ColPalWidget) w)->colpal.colpal_ctx;
  ctx->register_scroll_callback( (void *) scroll_data, scroll_callback);

  XtAddCallback( scroll_data->scroll_h, XmNvalueChangedCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNdragCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNincrementCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNdecrementCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNpageIncrementCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNpageDecrementCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNtoTopCallback, scroll_h_action, w);
  XtAddCallback( scroll_data->scroll_h, XmNtoBottomCallback, scroll_h_action, w);

  XtAddCallback( scroll_data->scroll_v, XmNvalueChangedCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNdragCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNincrementCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNdecrementCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNpageIncrementCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNpageDecrementCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNtoTopCallback, scroll_v_action, w);
  XtAddCallback( scroll_data->scroll_v, XmNtoBottomCallback, scroll_v_action, w);

  ctx->configure();

  if ( ((ColPalWidget) w)->colpal.init_proc)
    return (((ColPalWidget) w)->colpal.init_proc)( ctx, client_data);
  else
    return 1;
}