Article View: comp.windows.x.pex
Article #165Re: Drawing into DrawingArea widget
From: Sonja Orlavski
Date: Fri, 06 Nov 1992 01:17
Date: Fri, 06 Nov 1992 01:17
27 lines
1658 bytes
1658 bytes
Keith Baccki (kiki@bass.bu.edu) wrote:
:
: Drawing something into the Drawing Area should be a
: trivial task, but nonetheless the following pieces of code
: do NOTHING in the window:
:
: XFillRectangle(display,XtWindow(iondrawable),gc,(Position)50,(Position)50,(Dimension)200,(Dimension)200);
: XDrawLine(display,XtWindow(iondrawable),gc,(Position)
: 100,(Position) 100,(Position) 300,(Position) 150);
: XFlush(display);
I'm almost certain that this is your problem. You need to be doing these
commands in response to an Expose event (i.e. do an XtAddEventHandler to
your drawing area and put these commands into the event handler).
Otherwise, you're drawing into the window before it's shown up on the
screen.
You probably don't need the XFlush.
-Devin
--
Devin Hooker (RP90) (SotM 7/91) DoD #0034 devin@boulder.colorado.edu ------
"It's being both that's a bitch." --\--- /
"I wanted to take my brain to hell and back and see what I had left." \ \ //
"This howling in the distance, it's a captivating sound. \ \/
Can't tell if it's ecstasy or pain..." -DW \/
Technical Details
Message-ID:
<1992Nov6.011714.21164@colorado.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!boulder!devinReferences:
<100607@bu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.x.pex Path: arc1-ca.pugleaf.net!sparky!uunet!boulder!devin From: devin@frodo.Colorado.EDU (Sonja Orlavski) Subject: Re: Drawing into DrawingArea widget Message-ID: <1992Nov6.011714.21164@colorado.edu> Sender: news@colorado.edu (The Daily Planet) Nntp-Posting-Host: tsalmoth.colorado.edu Organization: University of Colorado, Boulder X-Newsreader: Tin 1.1 PL5 References: <100607@bu.edu> Date: Fri, 6 Nov 1992 01:17:14 GMT Lines: 27