home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.open-look
- Path: sparky!uunet!pipex!warwick!dcs.warwick.ac.uk!cmchan
- From: cmchan@dcs.warwick.ac.uk (C M Chan)
- Subject: Pop-up window for displaying images
- Message-ID: <1993Jan21.223753.23725@dcs.warwick.ac.uk>
- Keywords: Pop-up frame, canvas
- Sender: news@dcs.warwick.ac.uk (Network News)
- Nntp-Posting-Host: behind
- Organization: Department of Computer Science, Warwick University, England
- Date: Thu, 21 Jan 1993 22:37:53 GMT
- Lines: 73
-
-
- 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
-
-
-