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

message entry box at center

from Tkinter import *
def callback():
print e.get()
master=Tk()
e=Entry(master)
e.pack(anchor=CENTER)
e.focus_set()
b=Button(master,text="get",width=10,command=callba ck)
b.pack(anchor=CENTER)

master.mainloop()
i want to show the entry button at the center of the window. How is it
possible ??
Feb 28 '08 #1
3 1466
asit wrote:
i want to show the entry button at the center of the window. How is it
possible ??
from Tkinter import *
def callback():
print e.get()
master=Tk()
e=Entry(master)
e.pack(expand=True)
e.focus_set()
b=Button(master,text="get",width=10,command=callba ck)
b.pack(anchor=CENTER)

master.mainloop()
For more complex layouts have a look at the grid geometry manager.

Peter
Feb 28 '08 #2
On Feb 28, 7:53 pm, Peter Otten <__pete...@web.dewrote:
asit wrote:
i want to show the entry button at the center of the window. How is it
possible ??
from Tkinter import *
def callback():
print e.get()
master=Tk()
e=Entry(master)

e.pack(expand=True)
e.focus_set()
b=Button(master,text="get",width=10,command=callba ck)
b.pack(anchor=CENTER)
master.mainloop()

For more complex layouts have a look at the grid geometry manager.

Peter
but here there is another problem. there is a huge gap between get
button and message entry button when maximized.

pl z help. !!
Feb 28 '08 #3
asit wrote:
On Feb 28, 7:53 pm, Peter Otten <__pete...@web.dewrote:
>asit wrote:
i want to show the entry button at the center of the window. How is it
possible ??
from Tkinter import *
def callback():
print e.get()
master=Tk()
e=Entry(master)

e.pack(expand=True)
e.focus_set()
b=Button(master,text="get",width=10,command=callba ck)
b.pack(anchor=CENTER)
master.mainloop()

For more complex layouts have a look at the grid geometry manager.
but here there is another problem. there is a huge gap between get
button and message entry button when maximized.
Here are two more variants:

# large Entry widget
from Tkinter import *

master = Tk()
e = Entry(master)
e.pack(expand=1, fill=BOTH)
b = Button(master, text="get")
b.pack()

master.mainloop()

# nested Frame widget
from Tkinter import *

master = Tk()
panel = Frame(master)
panel.pack(expand=1)
e = Entry(panel)
e.pack()
b = Button(panel, text="get")
b.pack()

master.mainloop()

Peter
Feb 28 '08 #4

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

Similar topics

0
by: Mickel Grönroos | last post by:
Hi, I'm trying to put an Tkinter.Entry of fixed size onto a specific location on a canvas using the place manager. The idea is that one can double-click a rectangle object on a canvas to get an...
5
by: Thomas Scheiderich | last post by:
I am trying a script to write to the log and the script is: ********************************************************** <HTML> <HEAD> <TITLE>Add a Log Entry</TITLE> </HEAD> <BODY> <H3>Add a...
4
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
10
by: ahager via DotNetMonster.com | last post by:
I am receiving this messaage in a console application I wrote, I am authenticating, and my network admin swears their is nothing wrong with the smtp server. Any ideas? public void Mail_update()...
6
by: mhmtzdmr | last post by:
Hi, How can I insert an entry to datagrid without using db components? For example, I have a textbox and I would like to press OK button and insert the text in textbox to datagrid. Regards.
8
by: DP | last post by:
hi, i've got a price of code, which checks to see if a film is on rent, or available. but how can i actualyl make the cancel button do somthing? because, the cursor gets stuck on the filmID...
2
by: isaac2004 | last post by:
hi i am trying to send a html message that reiterates a invoice from a online store site im making, i have the invoice written to the browser but i would also like to send one to the customer via...
10
by: Lung.S.wu | last post by:
Hi all, It is a history question. Recently, I read the book "C A reference manual, third edition". In this book, it list all C language keyword, and one is "entry". I know it is omitted from...
1
by: togforev | last post by:
Why am I getting Microsoft VBScript runtime error 800a01f4? this is the code I believe it is coming from: <html> <head> <title>Sample</title> </head> <style type="text/css">
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.