473,322 Members | 1,719 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,322 software developers and data experts.

Grid question: How do I force grid elements to expand and use available space

Hi all,

Perplexed by this. I thought the sticky option was supposed to
accomplish this task, but it doesn't seem to be working. Here is what
I'm trying to accomplish.

Window
----------------------------
| --Beginning of group--
| Cell1 Cell2 Cell3
| Cell4 Cell5 Cell6
| -- End of group --
|
| --Beginning of group--
| Cell7 Cell8 Cell9
| Cell10 Cell11 Cell12
| -- End of group --
-----------------------------

Instead, here's what I'm getting:

----------------------------
| --Beginning of group--
| Cell1 Cell2 Cell3
| Cell4 Cell5 Cell6
| -- End of group --
|
| --Beginning of group--
| Cell7 Cell8 Cell9
| Cell10Cell11Cell12
| -- End of group --
-----------------------------
The cells in the top group are larger and take up more space;
therefore the cells below do not align correctly. I would like them to
all line up like they were in an spreadsheet. I want them in different
groups because they are in different categories, and I'm using the
group boundary as a separator.

Here is my code:

#### Insert options for Support Services
ssGroup = Pmw.Group(self.configScreen, tag_text="Support
Services", tag_foreground='dark green')

## Insert Title
Label( ssGroup.interior() , text='Part Number', font=('MS',
10, 'bold') ).grid(row=0, col=0, sticky=W, padx=0 )
Label( ssGroup.interior(), text='Description', font=('MS', 10,
'bold') ).grid(row=0, col=1, sticky=W, padx=2 )
Label( ssGroup.interior(), text='Quantity', font=('MS', 10,
'bold') ).grid(row=0, col=2, sticky=W, padx=0 )

x = 1
self.e = IntVar()
for part, list in info.masterList.items():
setattr( self.e, part, IntVar() )

for part, list in info.masterList.items():
print part
if list[5] == "ss":
Label( ssGroup.interior() , text=part ).grid(row=x,
col=0, sticky=W, padx=0 )
Label( ssGroup.interior(), text=list[0] ).grid(row=x,
col=1, sticky=W, padx=2 )
Entry( ssGroup.interior(), width=3, textvariable =
getattr(self.e, part),
text='0').grid(row=x, col=2, sticky=W, padx=4 )
e = getattr(self.e, part)
e.set(0)
x += 1

ssGroup.pack(expand=1, fill=X, ipady=5)

#### Insert options for Professional Services
psGroup = Pmw.Group(self.configScreen, tag_text="Professional
Services", tag_foreground='dark green')

## Insert Title
Label( psGroup.interior() , text='Part Number', font=('MS',
10, 'bold') ).grid(row=0, col=0, sticky=EW, padx=0 )
Label( psGroup.interior(), text='Description', font=('MS', 10,
'bold') ).grid(row=0, col=1, sticky=EW, padx=2 )
Label( psGroup.interior(), text='Quantity', font=('MS', 10,
'bold') ).grid(row=0, col=2, sticky=EW, padx=0 )
x = 1
for part, list in info.masterList.items():
print part
if list[5] == "ps":
Label( psGroup.interior() , text=part ).grid(row=x,
col=0, sticky=EW, padx=0 )
Label( psGroup.interior(), text=list[0] ).grid(row=x,
col=1, sticky=EW, padx=2 )
Entry( psGroup.interior(), width=3, textvariable =
getattr(self.e, part),
text='0').grid(row=x, col=2, sticky=EW, padx=4
)
e = getattr(self.e, part)
e.set(0)
x += 1

psGroup.pack(expand=1, fill=X, ipady=5)
The bottom group properly expands to take up the available space left
over from the larger top group. I thought that the sticky option was
supposed to make the cells expand, but it doesn't appear to do so in
this case. How do I force the grid cells to expand also?

Thanks ahead of time,
Marc
Jul 18 '05 #1
0 1793

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

Similar topics

6
by: Gary Richardson | last post by:
Is there a simple way of causing the size of a canvas to change as the window is resized when using the Grid geometry manager? Setting sticky='NESW', as in the following code, doesn't work though...
19
by: dchow | last post by:
Our database size is currently 4G and is incrementing at a rate of 45M/day. What is the max size of a SQL database? And what is the size beyond which the server performance will start to go down?
4
by: Geoff Soper | last post by:
I would like to arrange some photos in a simple grid. Each photo is either x pixels by y pixels or y pixels by x pixels (i.e. all the same size, arranged either in the landscape or portrait...
2
by: Jan Mueller | last post by:
Hi all, I don't know whether this is the right group, let me know :-). I tried to open this XML file (with internal DTD) with XMLSpy 2005. I guess some of you also use this tool. ...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
64
by: shaanxxx | last post by:
I have code which says #define MYBOOL int This code is very old. people who have written is not avaible. I was thinking what could be reason. 1) bool datatype was not available that time (10...
73
by: JoeC | last post by:
I am writing a game and I am having a challenge with my combat function. All I want to do is find out how to group pieces that are in the same space. There are two sides and all the units that...
2
by: =?ISO-8859-1?Q?Marco_K=F6rner?= | last post by:
Hello, I'm working on mapping the car's environment by updating an occupancy grid. An occupancy grid dicretizes the 3D space in small grid elements (voxels). A grid element contains informations...
7
by: dorandoran | last post by:
I used this article (http://www.codeproject.com/KB/webforms/EditNestedGridView.aspx) to accomplish expand/collaspe grid. I also added a search and it works. but i need to be now automatically expand...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.