Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add background and font color to widget in tkinter

# you can either use the regular color name or HEX value

pword_label = Label(text='Password', font=('calibre', 10, 'bold'), bg='black', fg='white')
pword_label.grid(row=3, column=0, pady=(10, 10))

# bg sets the background color
# while fg which means fore-ground color sets the font color
pword_entry = Entry(width=36, bg='green')
pword_entry.grid(row=3, column=1)

generate_btn = Button(text='Generate Password', bg='#E2D784')
generate_btn.grid(row=3, column=2)

save_btn = Button(text='save', width=36, bg='#006778', font=('Courier', 10, 'bold'), fg='white')
save_btn.grid(row=4, column=1, columnspan=2)
Comment

PREVIOUS NEXT
Code Example
Python :: usage code grepper 
Python :: simple plt plot 
Python :: hur många partier sitter i riksdagen 
Python :: print items of list using list comprehension in python 
Python :: get linkinstance revit api 
Python :: img_sm = pygame.transform.scale(img, (32, 32)) 
Python :: how to use visualize_runtimes 
Python :: AGE CALCULATOION IN PYTHON 
Python :: gnuplot sum over a column 
Python :: bash: line 1: templates/addtask.html: No such file or directory in flask app 
Python :: 1: for python position 
Python :: is cobol obsolete 
Python :: 12 hour clock to 24 hour clock in python 
Python :: run shell script to yaml file 
Shell :: remove steam from ubuntu 
Shell :: Error: You must install at least one postgresql-client-<version package 
Shell :: upgrade pip 
Shell :: the windows subsystem for linux component is not enabled 
Shell :: error gyp ERR! stack Error: not found: make 
Shell :: Warning: heroku update available from 7.47.4 to 7.47.5 
Shell :: remove all the containers docker 
Shell :: install snap on kalicannot communicate with server: Post "http://localhost/v2/snaps/core": dial unix /run/snapd.socket: connect: no such file or directory 
Shell :: check powershell version 
Shell :: docker stop all 
Shell :: manjaro clean up disk space 
Shell :: bash command for unzipping tar.gz files 
Shell :: remove oh my zsh ubuntu 
Shell :: install git winget 
Shell :: how to install gh-pages 
Shell :: reload ssh config 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =