[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1340.0. "When can I draw to a window" by KETJE::DIERICK (Let X equal X ...( L.A.)) Wed Aug 30 1989 06:15

Oops,
I thought I had posted a note with a question here, but apparently it did
not get in.
Since decwindows_programming is not available... :

This is the behaviour of my application :

1. With UIL I create a hierarchy which contains a main window, a menu bar
   with some options and a window.

2. I fetch the main window widget in my program

3. I manage the main window and its children

4. I call XtRealize

5. Before I go into my XtMainLoop, I try to draw a rectangle in the window,
   but it never shows up when I do 'run foo'

If I do a spawn of the program, then the rectangle does show up !
I guess it must have to do something with synchronization so I tried 

1. Do Xsynch and Xsynchronize before drawing the rectangle : no result

2. Do a XFlush after drawing the rectangle : no result.

3. Wait a few seconds before doing Xdrawrectangle, no result...

It puzzles me a bit, can anybody explain why I get this behaviour ?

Tnanks,

Dominique

T.RTitleUserPersonal
Name
DateLines
1340.1That should never workLBDUCK::SCHOELLERWho's on first?Wed Aug 30 1989 13:259
I am surprised that you ever see your box.  You can't draw into the window
until it is on the screen.  What you should do is wait for an Expose event
or a Visibility event and then draw.  The other question is which window are
you drawing in?  Is it a window widget?  If so, then use the expose_callback
for drawing your box.  If not, then it isn't supported and probably will cause
problems anyway.

Dick

1340.2KETJE::DIERICKLet X equal X ...( L.A.)Wed Aug 30 1989 13:454
Yep, I got a normal window allright.
Indeed that's what I thought it would be, you need the window first on the
screen. Nice suggestion of using expose event to avoid a wrong synchronization.