🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.open-look
1 messages
1 total messages Started by C M Chan Thu, 21 Jan 1993 22:37
Pop-up window for displaying images
#2757
Author: C M Chan
Date: Thu, 21 Jan 1993 22:37
71 lines
2343 bytes
Hi,

Can somebody out there please point me out explicitly the way to create a
Pop-up window in which an application can display images and handles input
with the XVIEW toolkit?

I have developed a simple program to create a Pop-up frame and its canvas
child in which a line will be drawn. However, I can't get what I want.


Any pointer will be greatly appreciated.   Thanks in advance.

---------------------------------------------------------------


#include <X11/Xlib.h>
#include <xview/xview.h>
#include <xview/canvas.h>
#include <xview/xv_xrect.h>
#include <xview/panel.h>


Frame frame;     /* top level application base-frame */
Frame subframe;  /* subframe (FRAME_CMD) is a child of frame */

void canvas_repaint_proc(Canvas, Xv_Window, Display*, Window, Xv_xrectlist*);

main(int argc, char **argv)
{
    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);

    /* Create base frame */
    frame = (Frame)xv_create(NULL, FRAME,
        FRAME_LABEL, argv[0],
        NULL);

    /* Create the command frame -- not displayed until XV_SHOW is set */
    subframe = (Frame)xv_create(frame, FRAME_CMD,
        FRAME_LABEL,         "Popup",
        NULL);

    (void) xv_create(subframe, CANVAS,
        CANVAS_REPAINT_PROC,    canvas_repaint_proc,
        CANVAS_X_PAINT_WINDOW,  TRUE,
        NULL);

    xv_set(subframe, XV_SHOW, TRUE, NULL);

    xv_main_loop(frame);
}

void
canvas_repaint_proc(Canvas canvas, Xv_Window paint_window,
                    Display *dpy,  Window xwin, Xv_xrectlist *xrects)
{
    GC gc;
    int width, height;

    gc = DefaultGC(dpy, DefaultScreen(dpy));
    width = (int)xv_get(paint_window, XV_WIDTH);
    height = (int)xv_get(paint_window, XV_HEIGHT);

    XDrawLine(dpy, xwin, gc, 0, 0, width, height);
}




-- 
C M CHAN         cmchan@dcs.warwick.ac.uk
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