473,802 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

message entry box at center

from Tkinter import *
def callback():
print e.get()
master=Tk()
e=Entry(master)
e.pack(anchor=C ENTER)
e.focus_set()
b=Button(master ,text="get",wid th=10,command=c allback)
b.pack(anchor=C ENTER)

master.mainloop ()
i want to show the entry button at the center of the window. How is it
possible ??
Feb 28 '08 #1
3 1484
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=T rue)
e.focus_set()
b=Button(master ,text="get",wid th=10,command=c allback)
b.pack(anchor=C ENTER)

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=T rue)
e.focus_set()
b=Button(master ,text="get",wid th=10,command=c allback)
b.pack(anchor=C ENTER)
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",wid th=10,command=c allback)
b.pack(anchor=C ENTER)
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(expa nd=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
2211
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 entry field of the same size as the rectangle placed exactly over the rectangle thus creating the effect that the rectangle has entered "input mode". When clicking return in the entry field, the value is fed back to a text object within the...
5
1984
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 Log Entry</H3>
4
2586
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 while its performing calculation... I'm using the below code...that i have got from following link http://aspfaq.com/show.asp?id=2498 but somehow it doesnt work and displays nothing....it display only for a second before the actual result is...
10
5516
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() { try { System.Web.Mail.MailMessage TME = new MailMessage(); TME.To = "adam_james98@hotmail.com";
6
1123
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
1978
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 field. this is wat i've got so far; Private Sub FilmID_BeforeUpdate(Cancel As Integer) If DCount("*", "tblFilmRental", "FilmID=" & Me!) > 0 Then Cancel = True
2
1297
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 email here is the code for the browser part dim strSessionID, strISBN, strTitle 'open database for cart strSQL = "SELECT tblCart.strSessionID, tblCart.strISBN, tblCart.intQty, tblBookDescription.strTitle, tblBookDescription.dblPrice " & _
10
4176
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 ANSCI C, but I hope I can find any data about it. Doea any one know how to use it, before?
1
960
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
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.