Beispiel #1
0
/*####################### destroy_error_history() #######################*/
void
destroy_error_history(void)
{
   if (error_shell != NULL)
   {
      XtDestroyWidget(error_shell);
      error_shell = NULL;
   }

   return;
}
Beispiel #2
0
int
UxDestroyInterface(Widget wgt)
#endif
{
    if (!(wgt = GetTrueToplevel(wgt)))
	return (UX_ERROR);

    XtDestroyWidget(wgt);

    return (UX_NO_ERROR);
}
Beispiel #3
0
/*####################### destroy_event_reason() ########################*/
void
destroy_event_reason(void)
{
   if (event_reason_shell != NULL)
   {
      XtDestroyWidget(event_reason_shell);
      event_reason_shell = NULL;
   }

   return;
}
GLXConfigurator::~GLXConfigurator() {
    if(mBackDrop)
        XFreePixmap(mDisplay, mBackDrop);
    if(toplevel) {
        XtUnrealizeWidget(toplevel);
        XtDestroyWidget(toplevel);
    }
    if(mDisplay) {
        XCloseDisplay(mDisplay);
    }
}
Beispiel #5
0
static void
warning_yes_callback(
	Widget w,
	XtPointer client_data,
	XtPointer call_data)
{
   G_do_copy=FALSE;
   G_wait_on_input = FALSE;
   if (G_over_dialog != NULL) {
     G_overwrite_selection = G_SKIP;
     XtDestroyWidget(G_over_dialog);
     G_over_dialog = NULL;
   }
   if (G_error_dialog != NULL) {
     XtDestroyWidget(G_error_dialog);
     G_error_dialog = NULL;
   }
   G_dialog_closed = TRUE;
   G_pause_copy = FALSE;
}
Beispiel #6
0
static void notify_goto_command_callback(Widget w, XtPointer client_data, 
			     XtPointer call_data)
{
  struct tile *ptile =  notify_goto_find_widget(w);

  center_tile_mapcanvas(ptile);
  notify_goto_widget_remove(w);

  XtDestroyWidget(XtParent(XtParent(w)));
  XtSetSensitive(toplevel, TRUE);
}
Beispiel #7
0
void MotifUI::NotifyDelete(BaseUI *obj)
{
   MotifUI *p = (MotifUI *) obj;
   if (p->_w)
    {
      XtRemoveCallback(_w, XmNdestroyCallback, &MotifUI::WidgetDestroyCB, 
		       (XtPointer) this);
      XtDestroyWidget(p->_w);
      p->_w = NULL;
    }
}
Beispiel #8
0
int Gtermgraphics (void) {
    int fi;

    for (fi = 0; fi < Gfontn; fi++)
        free (Gfontp[fi].name);
    Marrayfree (Gfontp), Gfontp = NULL, Gfontn = 0;
    Marrayfree (Gppp), Gppp = NULL, Gppn = 0;
    Marrayfree (Gbufp), Gbufp = NULL, Gbufn = 0;
    XtDestroyWidget (Groot);
    return 0;
}
Beispiel #9
0
static void
renameError_ok_callback(
	Widget w,
	XtPointer client_data,
	XtPointer call_data)
{
  XtDestroyWidget((Widget)client_data);
  XmProcessTraversal(G_rename_text, XmTRAVERSE_CURRENT);

  return;
}
Beispiel #10
0
static void popdownAction(Widget w, XtPointer client_data, XtPointer call_data)
{
client_data = client_data;    /* Keep picky compilers happy */
call_data = call_data;
if (highlighted_x >= 0)
  XawTextSinkDisplayText(queue_text_sink,
    highlighted_x, highlighted_y,
    highlighted_start, highlighted_end, 0);
XtDestroyWidget(w);
menu_is_up = FALSE;
}
Beispiel #11
0
static void
destroy(Widget w)
{
    /*
       printf("destroy()\n");
     */
    Disconnect(w);
    XtFree(Host_Name(w));
    XtFree(Host_Port(w));
    XtFree(Host_Terminator(w));
    XtFree(Host_OutputData(w));
    XtFree(Host_InputData(w));
    if (Host_Dialog(w))
    {
	XtDestroyWidget(Host_Dialog(w));
    }
    if (Host_SaveDialog(w))
    {
	XtDestroyWidget(Host_SaveDialog(w));
    }
}
//
//  Delete a nav context
//
CoXHelpNavMotif::~CoXHelpNavMotif()
{
  closing_down = 1;

  for ( int i = 0; i < brow_cnt; i++) {
    brow_DeleteSecondaryCtx( brow_stack[i]->ctx);
    brow_stack[i]->free_pixmaps();
    delete brow_stack[i];
  }
  delete brow;
  XtDestroyWidget( form_widget);
}
Beispiel #13
0
void wxChoice::Delete(unsigned int n)
{
    Widget w = (Widget)m_widgetArray[n];
    XtRemoveCallback(w, XmNactivateCallback, (XtCallbackProc)wxChoiceCallback,
                     (XtPointer)this);
    m_stringList.Erase(m_stringList.Item(n));
    m_widgetArray.RemoveAt(size_t(n));
    m_clientDataDict.Delete(n, HasClientObjectData());

    XtDestroyWidget(w);
    m_noStrings--;
}
Beispiel #14
0
void            
xt_client_destroy   (XtClient* xtclient)
{
  if(xtclient->top_widget) {
    XtRemoveEventHandler(xtclient->child_widget,
                         StructureNotifyMask | KeyPressMask,
                         TRUE, 
                         (XtEventHandler)xt_client_event_handler, xtclient);
    XtDestroyWidget(xtclient->top_widget);
    xtclient->top_widget = NULL;
  }
}
Beispiel #15
0
void CoWowMotif::list_cancel_cb( Widget w, XtPointer data, 
				 XmAnyCallbackStruct *cbs)
{
  wow_tListCtx ctx = (wow_tListCtx) data;
  
  if ( ctx->cancel_cb)
    (ctx->cancel_cb)( ctx->parent_ctx);

  XtDestroyWidget( ctx->toplevel);
  free( ctx->texts);
  free( ctx);
}
Beispiel #16
0
void CoWowMotif::question_cancel_cb ( Widget dialog, 
				      XtPointer data, 
				      XmAnyCallbackStruct *cbs)
{
  wow_t_question_cb *cbdata = (wow_t_question_cb *) data;
  
  if (cbdata->questionbox_cancel)
    (cbdata->questionbox_cancel)( cbdata->ctx, cbdata->data);

  XtFree ((char *)cbdata);
  XtDestroyWidget (dialog);
}
Beispiel #17
0
static void
DismissCallback(Widget btn, XtPointer client, XtPointer call)
{
  PlotDialogData *stuff = (PlotDialogData *) client;

  XtPopdown(stuff->shell);
  XtDestroyWidget(stuff->shell);
  free(stuff);
  DialogCount--;
  if (DialogCount == 0)
    exit(0);
}
Beispiel #18
0
void track_station_destroy_shell( /*@unused@*/ Widget widget, XtPointer clientData, /*@unused@*/ XtPointer callData) {
    Widget shell = (Widget) clientData;
    XtPopdown(shell);

begin_critical_section(&track_station_dialog_lock, "track_gui.c:track_station_destroy_shell" );

    XtDestroyWidget(shell);
    track_station_dialog = (Widget)NULL;

end_critical_section(&track_station_dialog_lock, "track_gui.c:track_station_destroy_shell" );

}
Beispiel #19
0
void wxChoice::DoDeleteOneItem(unsigned int n)
{
    Widget w = (Widget)m_widgetArray[n];
    XtRemoveCallback(w, XmNactivateCallback, (XtCallbackProc)wxChoiceCallback,
                     (XtPointer)this);

    m_stringArray.RemoveAt(size_t(n));
    m_widgetArray.RemoveAt(size_t(n));
    wxChoiceBase::DoDeleteOneItem(n);

    XtDestroyWidget(w);
}
/*
 * Procedure to make a bubble help widget
 *   Note that background, borderColor, and borderWidth are specified elsewhere
 */
static void makeBubbleHelpWidget(Widget w, char *label)
{
    Window child;
    Widget wparent=XtParent(w);
    XmString xmString;
    Position x,y;
    Dimension width,height;
    Arg args[20];
    int nargs;
    int xroot,yroot;

  /* Destroy any old one */
    if(bubbleHelpWidget) XtDestroyWidget(bubbleHelpWidget);
  /* Get location of widget relative to its parent */
    nargs=0;
    XtSetArg(args[nargs],XmNx,&x); nargs++;
    XtSetArg(args[nargs],XmNy,&y); nargs++;
    XtSetArg(args[nargs],XmNwidth,&width); nargs++;
    XtSetArg(args[nargs],XmNheight,&height); nargs++;
    XtGetValues(w,args,nargs);
  /* Translate the coordinates to the root window
   *  XmNx and XmNy are supposed to be relative to the parent, but they are not.
   *  They are relative to the root window */
    if(XTranslateCoordinates(XtDisplay(w),XtWindow(XtParent(w)),
      RootWindowOfScreen(XtScreen(w)),(int)x,(int)y,&xroot,&yroot,&child)) {
	x=xroot;
	y=yroot;
    }
  /* Create dialog shell */
    nargs=0;
    XtSetArg(args[nargs],XmNmwmDecorations,0); nargs++;
    XtSetArg(args[nargs],XmNmwmFunctions,0); nargs++;
    XtSetArg(args[nargs],XmNx,x+width/2+BUBBLE_DELTAX); nargs++;
    XtSetArg(args[nargs],XmNy,y+height+BUBBLE_DELTAY); nargs++;
    bubbleHelpWidget=XmCreateDialogShell(wparent,"bubbleHelpD",args,nargs);
  /* Create label */
    xmString=XmStringCreateLocalized(label);
    nargs=0;
    XtSetArg(args[nargs],XmNlabelString,xmString); nargs++;
    bubbleHelpWidgetLabel=XmCreateLabel(bubbleHelpWidget,"bubbleHelpDL",
      args,nargs);
    XtManageChild(bubbleHelpWidgetLabel);
    XtManageChild(bubbleHelpWidget);
    XmStringFree(xmString);
  /* Get location of widget */
    nargs=0;
    XtSetArg(args[nargs],XmNx,&x); nargs++;
    XtSetArg(args[nargs],XmNy,&y); nargs++;
    XtSetArg(args[nargs],XmNwidth,&width); nargs++;
    XtSetArg(args[nargs],XmNheight,&height); nargs++;
    XtGetValues(bubbleHelpWidget,args,nargs);
}
Beispiel #21
0
void
create_statusline(void)
{
    Position vport_h, clip_x, clip_w;
    static Position my_h = 0;

    /*
     * FIXME: is there a better way to set the y position depending on
     * the height of the widget?
     * It doesn't work to change the value of XtNy *after* creating
     * the widget!
     */

    if (!initialized) {
	/*
	 * determine height of statusline (depending on the font used).
	 * This is not changeable at runtime, so it's determined once and
	 * for all at program start.
	 */
	statusline = XtVaCreateWidget("statusline", labelWidgetClass, vport_widget,
				      XtNlabel, (XtArgVal) "test",
				      NULL);
	XtVaGetValues(statusline, XtNheight, &my_h, NULL);
	XtDestroyWidget(statusline);
	initialized = True;
	/* initialize g_string_savebuf */
#ifdef T1LIB
	sprintf(g_string_savebuf, "This is xdvik %s   (T1Lib rendering %s)",
		TVERSION, resource.t1lib ? "on" : "switched off");
#else
	sprintf(g_string_savebuf, "This is xdvik %s", TVERSION);
#endif	
    }
    /* determine position and width of statusline */
    XtVaGetValues(clip_widget, XtNx, &clip_x, XtNwidth, &clip_w, NULL);
    XtVaGetValues(vport_widget, XtNheight, &vport_h, NULL);
    if (vport_h - my_h <= 0) {
#ifdef DEBUG
	fprintf(stderr, "=======not printing statusline\n");
#endif /* DEBUG */
	return;
    }
    statusline = XtVaCreateManagedWidget("statusline", labelWidgetClass, vport_widget,
					 XtNlabel, (XtArgVal) g_string_savebuf,
					 XtNwidth, clip_w,
					 XtNx, clip_x - 1,	/* so that left border becomes invisible */
					 XtNy, vport_h - my_h,
					 XtNborderWidth, 1,
					 XtNjustify, XtJustifyLeft,
					 XtNborder, (XtArgVal) resource._fore_Pixel,	/* same as for the buttons line */
					 NULL);
}
Beispiel #22
0
static void
CreateCommandMenu(Widget parent, String toolkit)
{
    Arg args[1];

    if (cmenu) { XtDestroyWidget(cmenu); CM_set_insensitive = False; }
    else 
      cbutton = XtCreateManagedWidget("commands", menuButtonWidgetClass,
				      parent, NULL, ZERO);

    /* set the menu name to the toolkit name */
    XtSetArg(args[0], XtNmenuName, toolkit);
    XtSetValues(cbutton, args, ONE);

    cmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, cbutton,
			       NULL, ZERO);
    
    CM_entries[0] = XtCreateManagedWidget("sendTree", smeBSBObjectClass,cmenu,
					   NULL, ZERO);
    XtAddCallback(CM_entries[0], XtNcallback, SendTree, (XtPointer) TRUE);

    CM_entries[1]=XtCreateManagedWidget("refreshTree",smeBSBObjectClass,cmenu,
					 NULL, ZERO);
    XtAddCallback(CM_entries[1], XtNcallback, SendTree, (XtPointer) FALSE);

    CM_entries[2] = XtCreateManagedWidget("dumpTreeToFile", 
					   smeBSBObjectClass,cmenu,
					   NULL, ZERO);
    XtAddCallback(CM_entries[2], XtNcallback, DumpTreeToFile, NULL);

    CM_entries[3] = XtCreateManagedWidget("line", smeLineObjectClass, cmenu,
				  NULL, ZERO);
    CM_entries[4]= XtCreateManagedWidget("getResourceList", 
					  smeBSBObjectClass,cmenu,
					  NULL, ZERO);
    XtAddCallback(CM_entries[4], XtNcallback, GetResourceList, NULL);

    CM_entries[5] = XtCreateManagedWidget("setValues", smeBSBObjectClass, 
					   cmenu,
					   NULL, ZERO);
    XtAddCallback(CM_entries[5], XtNcallback, InitSetValues, NULL);

    CM_entries[6] = XtCreateManagedWidget("line", smeLineObjectClass, cmenu,
					   NULL, ZERO);

    CM_entries[7] = XtCreateManagedWidget("quit", smeBSBObjectClass, cmenu,
					   NULL, ZERO);
    XtAddCallback(CM_entries[7], XtNcallback, Quit, NULL);

    if (CM_set_insensitive) 
      SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False);
}
Beispiel #23
0
void ShowCurrentResidualProg()
{
   Position x, y;
   Cardinal n = 0;
   Arg args[12];
   Widget board, label, okbtn, cancelbtn, helpbtn;


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(args[0], XtNx, &x); n++;
   XtSetArg(args[1], XtNy, &y); n++;
   XtGetValues(dialogShell, args, n);

   board = XtVaCreateManagedWidget("board", boxWidgetClass,
				   dialogShell,
				   XtNx, x,
				   XtNy, y,
				   XtNwidth, 550,
				   XtNheight, 1000,
				   XtNresize, XawtextResizeBoth,
				   NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "        Show Current Residual Program       "); n++;
   label = XtCreateManagedWidget("label", labelWidgetClass,
				  board, args, n);
   XtVaSetValues(label, XtNfont, font0Struct, NULL);

   okbtn = XtCreateManagedWidget("OK", commandWidgetClass, board,
				 NULL, 0);
   XtVaSetValues(okbtn, XtNfont, font1Struct, NULL);

   cancelbtn = XtCreateManagedWidget("Cancel", commandWidgetClass, board,
				     NULL, 0);
   XtVaSetValues(cancelbtn, XtNfont, font1Struct, NULL);

   helpbtn = XtCreateManagedWidget("Help", commandWidgetClass, board,
				   NULL, 0);
   XtVaSetValues(helpbtn, XtNfont, font1Struct, NULL);

   XtAddCallback(okbtn, XtNcallback, ShowCurrentResidualProgOK, NULL);
   XtAddCallback(cancelbtn, XtNcallback, ShowCurrentPreprocessProgCancel, board);
   XtAddCallback(helpbtn, XtNcallback, ShowCurrentResidualProgHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Beispiel #24
0
/*
 * Callback for cancel button in choice_dialog.
 */
static void
cancel_action(Widget w, XtPointer client_data, XtPointer call_data)
{
    XtPointer p;
    ptrdiff_t idx = -1;
    
    UNUSED(call_data);

#if MOTIF
    /* for motif, the index is in XmNuserData */
    UNUSED(client_data);
    if (strcmp(XtName(w), Xdvi_MESSAGE_SHELL_NAME) == 0) {
	/* invoked by the WM, get the messagebox child */
	Widget child;
	if (get_widget_by_name(&child, w, Xdvi_MESSAGE_DIALOG_NAME, True)) {
	    XtVaGetValues(child, XmNuserData, &p, NULL);
	    idx = (ptrdiff_t)p;
	}
    }
    else {
	XtVaGetValues(w, XmNuserData, &p, NULL);
	idx = (ptrdiff_t)p;
    }
    ASSERT(idx >= 0, "Couldn't get idx from XmNuserData!");
#else
    UNUSED(p);
    UNUSED(w);
    idx = (ptrdiff_t)client_data;
#endif
    ASSERT(idx >= 0 && idx < MAX_POPUPS, "Invalid widget index in cancel_action()");

    /* First call pre_message_cb with window widget ID
     * as additional parameter.
     */
    if (pre_callbacks[idx].callback != NULL) {
	pre_callbacks[idx].callback(popup_window[idx], pre_callbacks[idx].arg);
    }
    
    /* Then pop down window and mark its position as free, then
     * invoke the OK callback.  The reason for this is that the callback
     * may need to wait for open windows.
     */
    XtPopdown(popup_window[idx]);
    XtDestroyWidget(popup_window[idx]);
    g_popup_array[idx] = 0;
    XSync(DISP, True);

    /* invoke the callback if present */
    if (cancel_callbacks[idx].callback != NULL) {
	cancel_callbacks[idx].callback(cancel_callbacks[idx].arg);
    }
}
Beispiel #25
0
/**************************************************************************
...
**************************************************************************/
void popupinfo_popdown_callback(Widget w, XtPointer client_data,
        XtPointer call_data)
{
  bool *full = client_data;

  if (*full) {
    update_map_canvas_visible();
  } else {
    dirty_all();
  }

  XtDestroyWidget(w);
}
Beispiel #26
0
void EndActFunc(Widget w, int id, int cdata)
{
    // garbage, just to remove warning
    void *ptr = w; if(ptr==NULL) { cdata=cdata; } 
    XtRemoveGrab(act.shell);
    XtUnmapWidget(act.shell);
    if (act.callBack) (act.callBack)(id);
    XtDestroyWidget(act.shell);
    act.active = 0;
    if (act.message) 
       free(act.message);
    return;
}
Beispiel #27
0
XsComponent::~XsComponent ( )
{

// Destroy the widget

   if (_base != 0)
   {
      _removeDestroyHandler ( );
      XtDestroyWidget (_base);
   }
      
   delete [] _name;
}
Beispiel #28
0
/*******************************************************************************
          Name:        printMatch
          Description: Simulates callbacks for dialog widget
          Arguments:  w - Dialog widget
                       client_data - Dialog widget
                       call_data - Not Used
          Returns:     None
*******************************************************************************/
static void printMatch(
  Widget w,
  XtPointer client_data, 
  XtPointer call_data)
{
  Boolean tempFlag;
  String aString = XawDialogGetValueString(XtParent(w));
  int length = strlen((char*)client_data);

  AppendCommandString(&(aString[length]));
  PrintRouter("stdin",&(aString[length]));
  XtDestroyWidget(XtParent(XtParent(XtParent(w))));
}
Beispiel #29
0
/**************************************************************************
...
**************************************************************************/
void option_ok_command_callback(Widget w, XtPointer client_data, 
			       XtPointer call_data)
{
  Boolean b;
  
  XtSetSensitive(main_form, TRUE);
  XtDestroyWidget(option_dialog_shell);

  XtVaGetValues(option_bg_toggle, XtNstate, &b, NULL);
  use_solid_color_behind_units=b;
  XtVaGetValues(option_bell_toggle, XtNstate, &b, NULL);
  sound_bell_at_new_turn=b;
}
Beispiel #30
0
/*
 * Destroy a balloon-eval and free its associated memory.
 */
    void
gui_mch_destroy_beval_area(BalloonEval *beval)
{
    cancelBalloon(beval);
    removeEventHandler(beval);
    /* Children will automatically be destroyed */
# ifdef FEAT_GUI_GTK
    gtk_widget_destroy(beval->balloonShell);
# else
    XtDestroyWidget(beval->balloonShell);
# endif
    vim_free(beval);
}