🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.interviews
1 messages
1 total messages Started by Don Walters Thu, 28 Jan 1993 19:06
Problem with unmap/map
#1594
Author: 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);
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads