I'm having a heck of a time trying to Refesh a panel. Here's the scenario...
I have a server application running on an embedded system and a client module in pure Python. I want to create a GUI application that shows the state of the connection on program startup. I have code in a wxFrame that looks something like this...
...
def PollForConnection(self):
while self.eth.Connected() is False:
time.sleep(5)
self.panel.Result.SetLabel('Connection Established')
self.panel.Refresh(True)
print 'Updating GUI'
sys.stdout.flush()
('Result' is a wxStaticText object)
The problem is that it can take anywhere between 0 and 20 seconds after the call to 'Refresh()' for the panel to redraw itself. Curiously, if there is a pending Refresh, the panel will redraw itself immediately when I drag the mouse pointer over it. I'm a wxWidgets newbie, so I'm at a bit of a loss here...
I'm using python 2.3 and wxWidgets 2.4.2 on Debian Linux... ideally, I would like a solution that works on both linux and MSWin. Anyone have any ideas? Thanks...
···
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
jahurt644@netscape.net wrote:
I'm having a heck of a time trying to Refesh a panel. Here's the scenario...
I have a server application running on an embedded system and a client module in pure Python. I want to create a GUI application that shows the state of the connection on program startup. I have code in a wxFrame that looks something like this...
...
def PollForConnection(self):
while self.eth.Connected() is False:
time.sleep(5)
self.panel.Result.SetLabel('Connection Established')
self.panel.Refresh(True)
print 'Updating GUI'
sys.stdout.flush()
('Result' is a wxStaticText object)
The problem is that it can take anywhere between 0 and 20 seconds after the call to 'Refresh()' for the panel to redraw itself. Curiously, if there is a pending Refresh, the panel will redraw itself immediately when I drag the mouse pointer over it. I'm a wxWidgets newbie, so I'm at a bit of a loss here...
I'm using python 2.3 and wxWidgets 2.4.2 on Debian Linux... ideally, I would like a solution that works on both linux and MSWin. Anyone have any ideas? Thanks...
This came up a while back, and from what I remember Refresh() pretty much just marks the window as "dirty" but calling Update() causes the dirty window to be immediately repainted. So you call Refresh() then Update(). I think ...
Paul Probert
Try calling self.panel.Result.Update() instead.
···
On Tue, 2004-09-28 at 17:13 -0400, jahurt644@netscape.net wrote:
I'm having a heck of a time trying to Refesh a panel. Here's the scenario...
I have a server application running on an embedded system and a client module in pure Python. I want to create a GUI application that shows the state of the connection on program startup. I have code in a wxFrame that looks something like this...
...
def PollForConnection(self):
while self.eth.Connected() is False:
time.sleep(5)
self.panel.Result.SetLabel('Connection Established')
self.panel.Refresh(True)
print 'Updating GUI'
sys.stdout.flush()
('Result' is a wxStaticText object)
--
Cliff Wells <clifford.wells@comcast.net>