gettingstarted
[Top] [All Lists]

Re: Update editField in a paint event

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Update editField in a paint event
From: Phil M <phil at mobleybros dot com>
Date: Mon, 31 Jan 2005 19:16:50 -0800
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <A061AB5E-73DF-11D9-85CC-000D93C6DE52 at spamcop dot net>
On Jan 31, 2005, at 3:27 PM, Barrie Jones wrote:

Can someone please let me know if the following editField behavior is normal or possibly caused by my program.

The setup:
I have an EditField that should be updated each time a graphics operation is performed. The update code, myField.text = str(number) is in a graphics method called by the canvas paint event.
 "number" is incremented every time the paint event is fired.

The problem:
myField.text appears to update with the first pass, but remains the same after each subsequent pass through the paint event.

If you are running OS X, then it is possible that the Paint event only gets called once, and therefore your Editfield only gets updated once. OS X uses what is called double buffering and will display the last picture unless you tell it to redraw.

Try something else -- in addition to drawing your picture also draw the number that you want incremented in the canvas as well. Do something like this:

   g.TextSize = 48
   g.ForeColor = &cFF00FF    // a nice visible color (pink)
   myNumber = myNumber + 1
   g.DrawString(Str(myNumber), 0, 48)

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>