From owner-freebsd-questions Tue Mar 25 18:17:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id SAA04992 for questions-outgoing; Tue, 25 Mar 1997 18:17:04 -0800 (PST) Received: from murkwood.gaffaneys.com (dialup13.gaffaneys.com [134.129.252.32]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA04958 for ; Tue, 25 Mar 1997 18:16:56 -0800 (PST) Received: (from zach@localhost) by murkwood.gaffaneys.com (8.8.5/8.8.5) id UAA11913; Tue, 25 Mar 1997 20:17:51 -0600 (CST) From: Zach Heilig Message-ID: <19970325201750.16289@gaffaneys.com> Date: Tue, 25 Mar 1997 20:17:50 -0600 To: questions@freebsd.org Subject: X11 programming... Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I know I should get a book, but I haven't figured out which of the available books are good. Any hints here would be appreciated (cost isn't really a very big issue; <= US$500 would be great). So, I thought I would see how far I could go just reading the man pages. Basically, I am just trying to get a window (white... or actually _any_ background) up on the screen. This is as far as I have gotten, but I just can't seem to get the window to display. I don't get any compile errors or run-time errors (anymore :-), but still I get nothing. I wonder what I am missing? /* * xtest.c: testing X functions... */ #include #include #include #include int main(void) { Display *disp; Window root; Window mainwin; int scrn; unsigned long black; unsigned long white; char *display; display = getenv("DISPLAY"); if (!display) display = ":0.0"; if (!(disp = XOpenDisplay(display))) { fprintf(stderr, "Error: Could not open the '%s' display.\n", display); exit(EX_UNAVAILABLE); } scrn = DefaultScreen(disp); root = RootWindow(disp, scrn); white = WhitePixel(disp, scrn); black = BlackPixel(disp, scrn); mainwin = XCreateSimpleWindow(disp, root, 10, 10, 150, 50, 2, white, white); XMapWindow(disp, mainwin); sleep(5); XCloseDisplay(disp); return 0; } -- Zach Heilig (zach@blizzard.gaffaneys.com) | ALL unsolicited commercial email /var/spool/news is 110% full, | is unwelcome. I avoid dealing please delete all the spam you can. | with companies that email ads.