home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / windows / openloo / 3830 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.9 KB  |  62 lines

  1. Newsgroups: comp.windows.open-look
  2. Path: sparky!uunet!das.wang.com!wang!news
  3. From: zong@huey.cs.huji.ac.il (Yaniv Azriel)
  4. Subject: Starting out
  5. Organization: Mail to News Gateway at Wang Labs
  6. Date: 15 Sep 92 16:26:09 GMT
  7. Message-ID: <5628@shum.huji.ac.il>
  8. Sender: news@wang.com
  9. Lines: 51
  10.  
  11. Hallo everyone.
  12.   I have began to program to the OpenLook GUI today, approx 10 hours ago!)
  13.  
  14.   I copied this simple hello program from a book by Dan Heller, compiled and 
  15. linked. On running it sang the usual segmentation fault blues and grinded to a 
  16. halt. The debugger claims the segmentation fault was generated by an obscure 
  17. routine by the name of  XrmStringToQuarkList. 
  18.  
  19.   Well, it all chineese to me. Now i am not a novice programmer, but having spend
  20. a whole working day, trying to execute an hello program, i am considering
  21. going back to Motif, which i had abondoned after taking one quick glance at an
  22. OpenLook application - pure beauty. I include the source, and hope some one can
  23. straighten me out.  
  24.  
  25. #include <xview/xview.h>
  26. #include <xview/frame.h>
  27. #include <xview/panel.h>
  28.  
  29. Frame frame;
  30.  
  31. main (argc, argv) 
  32. int argc;
  33. char *argv[];
  34.     {
  35.     Panel panel;
  36.     void quit();
  37.     xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  38.     frame = (Frame)xv_create (NULL, FRAME, FRAME_LABEL, argv[0],
  39.                   XV_WIDTH, 200,
  40.                    XV_HEIGHT, 100, NULL);
  41.     panel=(Panel)xv_create (frame, PANEL, NULL);
  42.     (void) xv_create (panel, PANEL_BUTTON, PANEL_LABEL_STRING, "quit",
  43.              PANEL_NOTIFY_PROC, quit, NULL);
  44.     
  45.     xv_main_loop(frame);
  46.     exit(0);
  47.     }
  48.  
  49. void quit() 
  50. {
  51.     xv_destroy_safe(frame);
  52. }
  53.  
  54. Thanks all.
  55.  
  56. PS. i am running the Xview toolkit, on a sun4 (running unix.. and X11). Am i
  57. making sense at all ?
  58. -------------------------------------------------------------------------------
  59. Yaniv Azriel        zong@huey.huji.ac.il        Users are irrelevant...
  60. -------------------------------------------------------------------------------
  61.  
  62.