Exemplo n.º 1
0
static void
showBalloon(void *data)
{
    char *text;
    WMView *view = (WMView*)data;
    Balloon *bPtr = view->screen->balloon;
    int x, y;
    Window foo;

    bPtr->timer = NULL;

    text = WMHashGet(bPtr->table, view);
    if (!text)
        return;

    XTranslateCoordinates(view->screen->display, view->window,
                          view->screen->rootWin, 0, 0, &x, &y, &foo);

    if (!bPtr->view->flags.realized)
        W_RealizeView(bPtr->view);

    showText(bPtr, x, y, view->size.width, view->size.height, text);

    bPtr->flags.noDelay = 1;
}
Exemplo n.º 2
0
void W_RealizeView(W_View * view)
{
	Window parentWID;
	Display *dpy = view->screen->display;
	W_View *ptr;

	assert(view->size.width > 0);
	assert(view->size.height > 0);

	if (view->parent && !view->parent->flags.realized) {
		wwarning("trying to realize widget of unrealized parent");
		return;
	}

	if (!view->flags.realized) {
		parentWID = view->parent->window;
		view->window = XCreateWindow(dpy, parentWID, view->pos.x, view->pos.y,
					     view->size.width, view->size.height, 0,
					     view->screen->depth, InputOutput,
					     view->screen->visual, view->attribFlags, &view->attribs);

		XSaveContext(dpy, view->window, ViewContext, (XPointer) view);

		view->flags.realized = 1;

		if (view->flags.mapWhenRealized) {
			W_MapView(view);
			view->flags.mapWhenRealized = 0;
		}

		WMPostNotificationName(WMViewRealizedNotification, view, NULL);
	}

	/* realize children */
	ptr = view->childrenList;
	while (ptr != NULL) {
		W_RealizeView(ptr);

		ptr = ptr->nextSister;
	}
}
Exemplo n.º 3
0
/*
 * WMRealizeWidget-
 * 	Realizes the widget and all it's children.
 *
 */
void WMRealizeWidget(WMWidget * w)
{
	W_RealizeView(W_VIEW(w));
}