473,231 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Refreshing GridBagSizer


Hey guys,

I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having
a frustrating time with refreshing it properly.

Essentially, I've got to refresh the contents of the GridBagSizer on
occasion with new values. The way I'm doing it works 4 times out of 5 but
on the 5th, *all* of the grid objects that are set to various positions in
the GBS are set to (0,0) :|

So, the way I refresh it is that I keep a record of all grid objects
inserted into the GridBagSizer and on refresh, I first iterate through that
list and destroy everything in it. I then call Clear() and then Layout()
and start adding new grid objects.
i.e. I do this:
for obj in self.gridObjects:
obj.Destroy()
self.gridObjects = []
self.gbs.Clear()
self.gbs.Layout
// Add all new gridObjects, recording them in self.gridObjects

Again, this works most all the time *except* that sometimes all newly added
grid objects will end up at (0,0) in the GBS :|

Am I refreshing it correctly? Has anybody experienced a similar issue?

I appreciate any help :)
Steve
--
View this message in context: http://www.nabble.com/Refreshing-Gri...html#a13917194
Sent from the Python - python-list mailing list archive at Nabble.com.

Nov 23 '07 #1
1 1551
On Nov 23, 12:48 pm, Steve S <stevesha...@hotmail.comwrote:
Hey guys,

I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having
a frustrating time with refreshing it properly.

Essentially, I've got to refresh the contents of the GridBagSizer on
occasion with new values. The way I'm doing it works 4 times out of 5 but
on the 5th, *all* of the grid objects that are set to various positions in
the GBS are set to (0,0) :|

So, the way I refresh it is that I keep a record of all grid objects
inserted into the GridBagSizer and on refresh, I first iterate through that
list and destroy everything in it. I then call Clear() and then Layout()
and start adding new grid objects.
i.e. I do this:
for obj in self.gridObjects:
obj.Destroy()
self.gridObjects = []
self.gbs.Clear()
self.gbs.Layout
// Add all new gridObjects, recording them in self.gridObjects

Again, this works most all the time *except* that sometimes all newly added
grid objects will end up at (0,0) in the GBS :|

Am I refreshing it correctly? Has anybody experienced a similar issue?

I appreciate any help :)
Steve
--
View this message in context:http://www.nabble.com/Refreshing-Gri...html#a13917194
Sent from the Python - python-list mailing list archive at Nabble.com.
You'll probably do better if you email the wxPython user's group for
these kinds of things. But I'll take a shot at it anyway.

Looking at the GridBagSizer's docs, I found it has the following
method: CheckForIntersection. You could use that to make sure there
are no intersections and then handle it when they occur.

See the docs for more info:

http://www.wxpython.org/docs/api/wx....zer-class.html

The mailing list is here:

http://wxpython.org/maillist.php

Without knowing what your layout scheme is or how you add the widgets
to the sizer, it's difficult to give a more specific answer. Since you
say it's a dialog, you might want to consider using a simpler sizer or
a group of simpler sizers nested in one another. There's an entry on
the wiki that might be helpful to you as well.

http://wiki.wxpython.org/UsingSizers

Hope that helps.

Mike
Nov 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam Endicott | last post by:
I'm having some trouble using an HtmlListBox with a GridBagSizer. I'm not sure how best to explain what's happening, but it seems that every time my frame gets resized, the HtmlListBox grows...
60
by: A.Translator | last post by:
I have been struggling with a page that is based on a table structure (because that is all I am feeling comfortable with at the moment) styled with css. One of the problems I run in to is Opera...
5
by: Jensen Bredal | last post by:
Hello, I need to display self refreshing information on a web page written with asp.net. I would image that the info would be displayed either as part of a user control or a web control. How can...
1
by: ncf | last post by:
Recently, I came across a presentation about wx.GridBagSizer while trying to look up more info to use it in an application, however, the presentation noted "Don't use GridBagSizer. Ever." Can...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.