Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I am sure that the Firefox code doesn't have to contain things like sub-second checking loops just to redisplay the contents of its own window.

You'd be wrong I'm afraid. And you can prove it to yourself. Find a website with a page that updates (say) once a minute. Cover the section that changes and wait 1 1/2 minutes then uncover it. Is what you uncover the same as it was 1/1/2 minutes ago? Or has it changed.

Surely the task of redrawing a window when it is revealed is down to the window manager, not the application whose window it is?

The best the window manager could do is cache the bits that you cover up and blit them back when you uncover it again; but that wouldn't then reflect any changes that have happened in the mean time. (Ask yourself: How could the window manager know what might have changed -- if anything -- without consulting the application?)

But that isn't what happens. When the window uncovers, An 'update rectangle' that denotes the uncovered region is sent as part of an update message to the applications window procedure and it is responsible for redrawing that rectangle.

That's a lightweight description of the process -- the real thing is far more complex (long ago I helped write and test the window manager used by OS/2's Presentation Manager) -- but close enough for discussion.

The best applications that have dynamic window content, draw into an off-screen window buffer; and simply blit the appropriate part of it on-screen in response to update messages. This effectively decouples the drawing process from user events. My biggest beef with Tk (and many other GUI toolkits) is that they do not give you direct access to the window buffers, which effectively prevents using this optimum strategy.

There have been attempts to move this functionality into some GUI toolkits, but with zoomable and scrollable windows, it means the application has to maintain the entire 'world content', even when large parts of it are off screen (and thus could be skipped for optimisation purposes), because the application is no longer in control of what is actually being displayed at any given time.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^5: Perl/Tk window contents disappear when obscured then revealed by BrowserUk
in thread Perl/Tk window contents disappear when obscured then revealed by Another Ed

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (5)
    As of 2014-08-28 04:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (256 votes), past polls