home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / intervie / 3654 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.2 KB  |  81 lines

  1. Newsgroups: comp.windows.interviews
  2. Path: sparky!uunet!think.com!spool.mu.edu!agate!stanford.edu!sc.zuken.com!daw
  3. From: daw@sc.zuken.com (Don Walters)
  4. Subject: Problem with unmap/map
  5. Message-ID: <9301281905.AA16187@sc.zuken.com>
  6. Sender: news@shelby.stanford.edu (USENET News System)
  7. Organization: Internet-USENET Gateway at Stanford University
  8. Date: Thu, 28 Jan 1993 19:06:49 GMT
  9. Lines: 70
  10.  
  11. I am having a problem re-mapping a window after calling unmap
  12. on that window.  Symptoms are:
  13.  
  14.     1. Have mapped a window (any ManagedWindow).
  15.     2. Call window->unmap(), and window->display()->sync();
  16.        Window unmaps just fine.
  17.     3. Call window->map();
  18.        The window maps, but it's contents are not displayed.
  19.        However, the InputHandler objects are still active.
  20.  
  21. I have checked that the draw method of the top-level glyph
  22. is getting called at map time, so it appears that the
  23. double-buffering is the problem.
  24.  
  25. Does anyone know of other things that should be done either
  26. when unmapping or re-mapping?  Do I need to unbind/bind?
  27.  
  28. Following is a simple example that demonstrates the problem.
  29. Thanks for any advice.
  30.  
  31. Don Walters
  32.  
  33. ----------------------------------------------
  34. #include <IV-look/kit.h>
  35. #include <InterViews/background.h>
  36. #include <InterViews/display.h>
  37. #include <InterViews/layout.h>
  38. #include <InterViews/session.h>
  39. #include <InterViews/window.h>
  40. #include <stdio.h>
  41. #include <unistd.h>
  42.  
  43. static ApplicationWindow* appWindow;
  44.  
  45. class App {
  46. public:
  47.     void msg();
  48. };
  49.  
  50. declareActionCallback(App)
  51. implementActionCallback(App)
  52.  
  53. void App::msg() {
  54.     appWindow->unmap();
  55.     appWindow->display()->sync();
  56.     Session::instance()->quit();
  57. }
  58.  
  59. int main(int argc, char** argv) {
  60.     Session* session = new Session("Unmap", argc, argv);
  61.     WidgetKit& kit = *WidgetKit::instance();
  62.     const LayoutKit& layout = *LayoutKit::instance();
  63.     App* a = new App;
  64.     appWindow = 
  65.     new ApplicationWindow(
  66.         kit.inset_frame(
  67.         layout.margin(
  68.             kit.push_button(
  69.             "Push Me To Unmap", new ActionCallback(App)(a, &App::msg)
  70.             ),
  71.             10.0
  72.         )
  73.         )
  74.     );
  75.     session->run_window(appWindow);
  76.     printf("sleeping for 3 seconds, then remapping.\n");
  77.     sleep(3);
  78.     appWindow->map();
  79.     session->run_window(appWindow);
  80. }
  81.