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

tkinter, overwrite Label-text?

using python And tkinter.

i have a GUI that outputs a text among other things. after input form
user i want this text to be *)cleared and/or
*)overwritten.

what is the best way to achieve that?

also, how do i make Label-text expand to the right and not to the left?
Apr 10 '08 #1
4 4524
On Apr 10, 2:35 pm, skanem...@yahoo.se wrote:
using python And tkinter.

i have a GUI that outputs a text among other things. after input form
user i want this text to be *)cleared and/or
*)overwritten.

what is the best way to achieve that?
[...]
Which widget do you use?

Some widgets can be connected to variables so that when the variable
changes the widget is automatically update.
Have a look <at http://docs.python.org/lib/node696.html>.

HTH,
Dennis Benzinger
Apr 10 '08 #2
On 10 Apr, 15:28, "Dennis.Benzin...@gmx.net"
<dennis.benzin...@gmx.netwrote:
On Apr 10, 2:35 pm, skanem...@yahoo.se wrote:
using python And tkinter.
i have a GUI that outputs a text among other things. after input form
user i want this text to be *)cleared and/or
*)overwritten.
what is the best way to achieve that?
[...]

Which widget do you use?

Some widgets can be connected to variables so that when the variable
changes the widget is automatically update.
Have a look <athttp://docs.python.org/lib/node696.html>.

HTH,
Dennis Benzinger
i use the Label-widget.
Apr 10 '08 #3
On Apr 10, 4:37 pm, skanem...@yahoo.se wrote:
[...]
i know how to do this already. the problem is i want the text to stay
in the windowa nd not start overwriting "Answer:".
i have solved this by using an Entry for the answer as well but id
prefer using a Label.
[...]
You can set the width option of the Label. For example:

b = Label(mygui, text=eval(expr), width=20)

Then the Label will always be 20 characters wide no matter how long
the answer is.
You can read more about the options for Tk widgets in <http://
www.tcl.tk/man/tcl8.5/TkCmd/contents.htm>.

Dennis Benzinger
Apr 10 '08 #4
On Thu, 10 Apr 2008 07:37:08 -0700, skanemupp wrote:
i know how to do this already. the problem is i want the text to stay
in the windowa nd not start overwriting "Answer:".
Then don't use `place()` but let Tkinter handle the layout with the pack
and/or grid layout manager. GUIs with `place()` are a bad idea because
the GUI may look odd or is even unusable on other peoples computers with
other screen resolutions, fonts, and font sizes.

Ciao,
Marc 'BlackJack' Rintsch
Apr 10 '08 #5

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

Similar topics

3
by: Rob Andrews | last post by:
I'm on a Red Hat 9 system, which has Python 2.2.2 installed, and I installed 2.3 separately into /home/rob/Python-2.3/ (creating the symbolic link "py23" to point to my 2.3 installation). Now I'm...
1
by: Patrick L. Nolan | last post by:
We have a Tkinter application which has a menubar with cascade submenus. I would like to start the program with one of the submenu items state=DISABLED, then change it to state=NORMAL at a later...
1
by: Philippe C. Martin | last post by:
Hi, I have he following need and do not find an easy way out: I have many menu items and would like them all to call the same method -However, I need the method called to react differently...
4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
6
by: Bob Greschke | last post by:
Root.option_add("*?????*font", "Helvetica 12 bold") Want to get rid of the "font =": Widget.add_cascade(label = "File", menu = Fi, font = "Helvetica 12 bold") Does anyone know what ?????...
2
by: ishtar2020 | last post by:
Hi everybody I'd appreciate some help on creating a tear off menu with TkInter. I've been reading some documentation but still no luck. Please don't get confused: when I mean "tear off" menu I...
2
by: Dustan | last post by:
I don't know if this is because of Tkinter (ie Tk) itself or the Windows default way of handling things, but when I create a very long menu (my test is shown below), the way it displays is rather...
4
by: Edward K. Ream | last post by:
Hello all, Creating a 'Help' menu 'by hand' on the Mac does not work, or rather, it creates a *second* Help menu. There are hints about how to do this at:
3
by: seanacais | last post by:
I'm trying to build an unknown number of repeating gui elements dynamically so I need to store the variables in a list of dictionaries. I understand that Scale "variable" name needs to be a...
0
by: dudeja.rajat | last post by:
On Mon, Aug 25, 2008 at 12:57 PM, <dudeja.rajat@gmail.comwrote: Ok...now I found the way to do that. But I'm stuck further. my code is as below: main module ********************** myRoot...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.