473,379 Members | 1,312 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,379 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 1558
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.