🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1594

Problem with unmap/map

#1594
From: Don Walters
Date: Thu, 28 Jan 1993 19:06
70 lines
2315 bytes
I am having a problem re-mapping a window after calling unmap
on that window.  Symptoms are:

    1. Have mapped a window (any ManagedWindow).
    2. Call window->unmap(), and window->display()->sync();
       Window unmaps just fine.
    3. Call window->map();
       The window maps, but it's contents are not displayed.
       However, the InputHandler objects are still active.

I have checked that the draw method of the top-level glyph
is getting called at map time, so it appears that the
double-buffering is the problem.

Does anyone know of other things that should be done either
when unmapping or re-mapping?  Do I need to unbind/bind?

Following is a simple example that demonstrates the problem.
Thanks for any advice.

Don Walters

----------------------------------------------
#include <IV-look/kit.h>
#include <InterViews/background.h>
#include <InterViews/display.h>
#include <InterViews/layout.h>
#include <InterViews/session.h>
#include <InterViews/window.h>
#include <stdio.h>
#include <unistd.h>

static ApplicationWindow* appWindow;

class App {
public:
    void msg();
};

declareActionCallback(App)
implementActionCallback(App)

void App::msg() {
    appWindow->unmap();
    appWindow->display()->sync();
    Session::instance()->quit();
}

int main(int argc, char** argv) {
    Session* session = new Session("Unmap", argc, argv);
    WidgetKit& kit = *WidgetKit::instance();
    const LayoutKit& layout = *LayoutKit::instance();
    App* a = new App;
    appWindow = 
	new ApplicationWindow(
	    kit.inset_frame(
		layout.margin(
		    kit.push_button(
			"Push Me To Unmap", new ActionCallback(App)(a, &App::msg)
		    ),
		    10.0
		)
	    )
	);
    session->run_window(appWindow);
    printf("sleeping for 3 seconds, then remapping.\n");
    sleep(3);
    appWindow->map();
    session->run_window(appWindow);
}
Technical Details
Message-ID: <9301281905.AA16187@sc.zuken.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!spool.mu.edu!agate!stanford.edu!sc.zuken.com!daw

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!spool.mu.edu!agate!stanford.edu!sc.zuken.com!daw
From: daw@sc.zuken.com (Don Walters)
Subject: Problem with unmap/map
Message-ID: <9301281905.AA16187@sc.zuken.com>
Sender: news@shelby.stanford.edu (USENET News System)
Organization: Internet-USENET Gateway at Stanford University
Date: Thu, 28 Jan 1993 19:06:49 GMT
Lines: 70