home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / fblnk224.zip / message.c < prev    next >
C/C++ Source or Header  |  1999-01-28  |  1KB  |  55 lines

  1. /*  message.c  */
  2. /*  part of a fitsblink program  */
  3. /*  Jure Skvarc, 1998  */
  4. #include <stdio.h>
  5. #include <forms.h>
  6.  
  7. #include "functs.h"
  8.  
  9. extern STATE state;
  10.  
  11. /*=======================================*/
  12. /*  Create and display a message window  */
  13. /*=======================================*/
  14. void
  15. open_message(char *a)
  16.  
  17. {
  18.   /*  The window in not created yet, do it now  */
  19.   if (state.message == NULL) {
  20.     state.message = create_form_Message();
  21.   }
  22.   if (!fl_form_is_visible(state.message->Message)) {
  23.     fl_show_form(state.message->Message,  FL_FIX_SIZE, FL_FULLBORDER | FL_PLACE_FREE_CENTER, a);
  24.   }
  25.   fl_deactivate_all_forms();
  26.   fl_activate_form(state.message->Message);
  27. }
  28.  
  29.  
  30. /*=======================================*/
  31. /*  Close a message window  */
  32. /*=======================================*/
  33. void
  34. close_message(void)
  35.  
  36. {
  37.   if (state.message != NULL)
  38.     fl_hide_form(state.message->Message);
  39.   fl_activate_all_forms();
  40. }
  41.  
  42.  
  43. /*=======================================*/
  44. /*  Write a string into a message window */
  45. /*=======================================*/
  46. void
  47. write_message(char *a)
  48.  
  49. {
  50.   if (state.message != NULL) {
  51.     fl_set_object_label(state.message->messagetextW, a);
  52.     XFlush(state.disp);
  53.   }
  54. }
  55.