Mar-26-2018, 11:24 AM
(This post was last modified: Mar-26-2018, 11:41 AM by notsolowki.)
this here is amost exactly what i need. now i cant figure out how to prevent it from making new text entry boxes. i would just like it to update the variable im trying to print but not create a new line/text box every time. if i run this code in a loop it keeps creating new boxes with the text i would just like it to update the same box?
[inline]from Tkinter import *
def onclick():
pass
root = Tk()
text = Text(root)
with open('sensData.txt') as f:
newText = f.read()
text.insert(END, newText)
text.pack()
text.update_idletasks()
text.tag_add(newText, "1.0", "1.2")
text.tag_add("start", "1.0", "1.3", "2.0", "2.2")
text.tag_config("start", background="black", foreground="green")
root.mainloop()
[/inline]
sorry for blowing up this thread, but i think ive sorta figured some things out. ill start with this
" self.T.configure(fg='#0059b3', font=("bold", 22))" and see where i can get from here. thanks again
[inline]from Tkinter import *
def onclick():
pass
root = Tk()
text = Text(root)
with open('sensData.txt') as f:
newText = f.read()
text.insert(END, newText)
text.pack()
text.update_idletasks()
text.tag_add(newText, "1.0", "1.2")
text.tag_add("start", "1.0", "1.3", "2.0", "2.2")
text.tag_config("start", background="black", foreground="green")
root.mainloop()
[/inline]
(Mar-26-2018, 11:21 AM)Larz60+ Wrote:i tried something similar to that for the past 2 days ive been googling examples and i always get an error about syntax at the = signs. for the example you showed me i get a error about the syntax of the = after "family" sorry i didnt see you post before that last post i made. ive been experimenting with anything i can get close to work. this python is way different that the c++ on the arduino platform. until 2 days ago i have never messed with python.self.T.configure(font= (family='Helvetica', size=14, weight='', fg='#0059b3'))Not tested, but if not this, very close, see:http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/fonts.html
fg = text forground color
color selection can be found here: https://www.w3schools.com/colors/colors_picker.asp
sorry for blowing up this thread, but i think ive sorta figured some things out. ill start with this
" self.T.configure(fg='#0059b3', font=("bold", 22))" and see where i can get from here. thanks again