Note that there are some explanatory texts on larger screens.

plurals
  1. POlinux C++ xlib, does the processor go to fast?
    primarykey
    data
    text
    <p>here something sound like tricky for me, actualy i'm using Xlib to draw some windows. One is for plotting some 2D results in a image, so this one is drawn only when all calculus are done. another one is a simple window wich says, "calculus in process".</p> <ul> <li>So now before I start the calculus I call "show me the simple window "calculus in process"",</li> <li>then I call the function who does the calculs and plots the result,</li> <li>then I call "don't show me the simple window "calculus in process"".</li> </ul> <p>but the problem ams, I don't see the "show me the simple window "calculus in process"" during the calculus, I just see it one instant and disappears just when the image of results of calculs is shown. I try to put some <code>sleep()</code> but that doesn't solve the problem. What kind of stuff can cause such problem ? I already met such problem during my C++ course, at that time I worked on console, I never found the reason of such problem. </p> <p>Can somebody give me some explanation and tips to help me to deal with it like a boss ?</p> <p>here a piece of sh.. of my code :</p> <pre><code>switch(e.type/*xlibevent*/){ . . . case KeyRelease : switch(keyRelease()){ // keyRelease just recognize wich key was released . . . // w3w1 = window "calculus in process" case 3 : w3w1.switcher(); doCalculus(&amp;w1); w3w1.switcher(); break; . . . . . . } </code></pre> <p>I just did a test, I swap <code>doCalculus(&amp;w1)</code> with <code>sleep(3)</code> same result, I don't see my window "calculus in process"</p> <p>there is the <code>switcher()</code> <strong><em>corrected</em></strong></p> <pre><code> void switcher(){ if(this-&gt;visible==0){ XMapWindow(dpy,this-&gt;window); // what I though before : has to map the window // what I think now : request to map the window XDrawString(dpy, this-&gt;window, this-&gt;gc, 10, 14, text.c_str(), text.length()); XFlush(dpy); // dats what missed, not sure that efficient to flush the dpy // but I deal with the part of xlib I know, I will check further // about that visible=1; }else{ XUnmapWindow(dpy,this-&gt;window); XFlush(dpy); //... visible=0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload