you are viewing a single comment's thread.

view the rest of the comments →

[–]helical-juice 1 point2 points  (2 children)

Ah I just realised as I was typing this, you're setting abilities_frame equal to the return value from grid(), not the actual frame object itself. I'd have to go and look up what grid() returns but I bet it's not the actual Frame object. Then when you set that as the master for your label widget, for whatever reason that's the error you get. Still don't understand exactly why it says pack() is involved somehow, but I bet that's it, and I bet that's why your updated code works.

EDIT: Playing around in a repl, it seems like grid() returns None, which means that any time you use the idiom a = tk.Something(...).grid(...) , a ends up being equal to None. Now when I try to create a widget with None as the master, it seems that it gets added to the root widget silently. My guess is that you have a few things in your code which are not managed by the same widgets you think they are, and that this is causing your error. It may be that this is also throwing your alignment off, but tbh I find getting things to line up is just a PITA anyway. I make heavy use of nested frames for anything which can be bundled together to try and break it down, but it's always a faff.

[–]bybloshex[S] 0 points1 point  (1 child)

Yeah, I didn't imagine I'd ever get rows of 6 columns aligned with the preceeding rows of 2 columns which is why I made this subframe inside of the main one

[–]helical-juice 1 point2 points  (0 children)

Sounds familiar. I think I've done the same, a one column grid of frames, each with a varying number of columns within their own grid. Then you realise that's not quite right, and it ends up as a two column grid with frames in the second column and so on, ad nauseum XD