~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/Xm/tw_dialog.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <tina/sys.h>
  5 #include <tina/math.h>
  6 #include <tina/tv.h>
  7 #include  <tina/mtw.h>
  8 #include  <tina/tv_screen.h>
  9 #include <tina/Xmfuncs.h>
 10 
 11 static Widget bb, dialog;
 12 
 13 static void dialog_cmnd(Tw_callback * twc, char *args)
 14 {
 15     int     x, y, w, h;
 16 
 17     (void) sscanf(args, "%*s %d %d %d %d", &x, &y, &w, &h);
 18     tw_set_geom(twc->widget, x, y, w, h);
 19 }
 20 
 21 static void dialog_prnt(FILE * fp, Tw_callback * twc)
 22 {
 23     int     x, y, w, h;
 24 
 25     tw_get_geom(twc->widget, &x, &y, &w, &h);
 26     (void) fprintf(fp, "%s %d %d %d %d\n", twc->name, x, y, w, h);
 27 }
 28 
 29 void    tw_show_dialog(Widget bb)
 30 {
 31     XtManageChild(bb);
 32 }
 33 
 34 static void dismiss_proc(Widget bb)
 35 {
 36     XtUnmanageChild(bb);
 37 }
 38 
 39 Widget  tw_dialog(char *name)
 40 {
 41     int     nargs;
 42     Arg     wargs[10];
 43     Tw_callback *twc;
 44     char   *dialogname;
 45 
 46     nargs = 0;
 47     XtSetArg(wargs[nargs], XmNautoUnmanage, FALSE);
 48     nargs++;
 49     XtSetArg(wargs[nargs], XmNautoUnmanage, FALSE);
 50     nargs++;
 51     bb = XmCreateBulletinBoardDialog(tw_get_tool(),
 52                                      "twpanel", wargs, nargs);
 53     tw_set_panel(bb);
 54 
 55     dialog = XtParent(bb);
 56     nargs = 0;
 57     XtSetArg(wargs[nargs], XmNtitle, name);
 58     nargs++;
 59     XtSetValues(dialog, wargs, nargs);
 60 
 61     tw_firstrow();
 62 
 63     tw_set_toolname(dialogname = tw_extend_fullname(tw_get_toolname(), name));
 64     twc = tw_callback_make(dialogname, dialog, dialog, (void (*) ()) NULL,
 65                          dialog_cmnd, dialog_prnt, (void (*) ()) NULL,
 66                            NULL, NULL);
 67     tw_register_callfrom(twc);
 68     return (bb);
 69 }
 70 
 71 void    tw_end_dialog(void)
 72 {
 73     tw_newrow();
 74     tw_button("Dismiss", dismiss_proc, bb);
 75     tw_newrow();
 76     tw_set_tina_cursor(XtDisplay(dialog), XtWindow(dialog));
 77 
 78     tw_set_size(dialog, tw_get_totwidth(), tw_get_totheight());
 79     XtManageChild(bb);
 80 }
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.