Python tkinter grid problem?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Python tkinter grid problem?
# 1  
Old 06-19-2004
Question Python tkinter grid problem?

There seems to be some problem with the grid geometry manager, or maybe its just my syntax thats incorrect. Im using Python 2.3.4. My problem is that even when I use the sticky='news' option in any grid method, it just doesnt work period. For example, the following code gives be a window with a small button in the middle. The desired effect was a button whos size matched the size of the window.

Code:
# import resources
from Tkinter import *

# the root window
root=Tk()
root.geometry('200x100')
root.title('Grid Tester')
root.resizable(0, 0)
# the tester frame
tester=Button(root, text="Test")
tester.grid(row=0, column=0, sticky='nsew')

# the event loop
root.mainloop()

I have tried a few other things such as, sticky=NSEW, sticky=nsew, sticky="NSEW". I hope it doesnt matter what order you put them in.. Please let me know if this is a problem with my syntax, and correct me if so. Also, this is my first post on unix.com so... HELLO EVERY ONE!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python problem with input

Hello everyone, I have just started python, and there is something that escapes me. I don't understand why my little script doesn't work. When I do, it work: my_string = "bonjour" if len(my_string) < "6": print(my_string + " < 6") else: print(my_string + " > 6") ... (2 Replies)
Discussion started by: Arnaudh78
2 Replies

2. Shell Programming and Scripting

Python SSH problem

Hello geeks, Am trying to write a custom plugin using python but it seems python is not handling the SSH part well, find below for the code: #!/usr/bin/python import os, sys host = sys.argv pdpactgsm=os.popen("ssh -l GbeAdi $host "pdc_kpi.pl" | grep -A 4 sgsn_g | awk 'NR == 5 ' |... (1 Reply)
Discussion started by: infinitydon
1 Replies

3. AIX

Strange problem running python program from within ant

Hello, I'm currently trying to port an ant based build to AIX 6.1. The build queries the underlying version control system (Mercurial) for some data, which works fine on other platforms (Linux, Solaris). However, on AIX the hg command fails to load python's md5 module when used in the build,... (1 Reply)
Discussion started by: dhs
1 Replies

4. Shell Programming and Scripting

Problem with python script

I have a txt file of 8GB with same type of messages in it. for eg: MTQ_BQUOTE, Length: 40, Timestamp: 4:00:52.064 MsgKey: symbol: XXX | reportingExchange: 11 Symbol: XXX, hash 004C5746 QS Symbol: XXX, market 1 Security Type: EQUAL (1) Symbol Type: Equity.Share.Single.None Session: XX_XXX (0)... (9 Replies)
Discussion started by: Vijeta Laad
9 Replies

5. Shell Programming and Scripting

Problem passing arguments to a Python script

I have part of the script below and I tried calling the script using ./tsimplex.py --fstmod=chris.cmod --nxz=8x6 --varp=0.25 but am getting the error option --fstmod must not have an argument Any idea on how to fix this would be highly appreciated #! /usr/bin/python import... (0 Replies)
Discussion started by: kristinu
0 Replies

6. UNIX for Dummies Questions & Answers

problem with python on mac

Hi, I'm sure there's a very easy way to fix this but i'm a newbie so I'm posting this. The problem is that whenever I run python on the terminal I can no longer use the left and right arrows to move left or right, or the up/down arrows to call commands used before. Whenever I click an arrow I get... (0 Replies)
Discussion started by: thefloydpink
0 Replies

7. High Performance Computing

how to do GRID COMPUTING?

Hello, I want to know how to combine the processing power of given 2 FEDORA machines in LAN. Can you please tell me the commands,etc used to perform such an operations.Can you please give me the links where I can find more info on this topic. (5 Replies)
Discussion started by: nsharath
5 Replies

8. High Performance Computing

Grid vs. Parallel vs. Distributed

Hello all, I was wondering if someone could either explain or maybe point me to another article somewhere that explains the difference between: distributed computing grid computing parallel computing I see these terms thrown around a lot in server and cluster environments, but I'd like a... (2 Replies)
Discussion started by: Heathe_Kyle
2 Replies

9. Shell Programming and Scripting

How to create a grid file

Hi everybody: I want to create a grid file for export to statistical program. My aid is create a file with both rows, one row are x coordenates and other for y coordenates. All grid obviousolly are same space. the form that i want is this: x=(400000 ........ 600000) and y=(4000000 .......... (1 Reply)
Discussion started by: tonet
1 Replies
Login or Register to Ask a Question
Tk_SetGrid(3)						       Tk Library Procedures						     Tk_SetGrid(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tk_SetGrid, Tk_UnsetGrid - control the grid for interactive resizing SYNOPSIS
#include <tk.h> Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc) Tk_UnsetGrid(tkwin) ARGUMENTS
Tk_Window tkwin (in) Token for window. int reqWidth (in) Width in grid units that corresponds to the pixel dimension tkwin has requested via Tk_GeometryRequest. int reqHeight (in) Height in grid units that corresponds to the pixel dimension tkwin has requested via Tk_GeometryRequest. int widthInc (in) Width of one grid unit, in pixels. int heightInc (in) Height of one grid unit, in pixels. _________________________________________________________________ DESCRIPTION
Tk_SetGrid turns on gridded geometry management for tkwin's toplevel window and specifies the geometry of the grid. Tk_SetGrid is typi- cally invoked by a widget when its setGrid option is true. It restricts interactive resizing of tkwin's toplevel window so that the space allocated to the toplevel is equal to its requested size plus or minus even multiples of widthInc and heightInc. Furthermore, the reqWidth and reqHeight values are passed to the window manager so that it can report the window's size in grid units during interactive resizes. If tkwin's configuration changes (e.g., the size of a grid unit changes) then the widget should invoke Tk_SetGrid again with the new informa- tion. Tk_UnsetGrid cancels gridded geometry management for tkwin's toplevel window. For each toplevel window there can be at most one internal window with gridding enabled. If Tk_SetGrid or Tk_UnsetGrid is invoked when some other window is already controlling gridding for tkwin's toplevel, the calls for the new window have no effect. See the wm manual entry for additional information on gridded geometry management. KEYWORDS
grid, window, window manager Tk 4.0 Tk_SetGrid(3)