abnormal appearance of Entry Widget #2394
Unanswered
doctorvineet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am making a small python application for myself and I am facing problem after I created it. I created entry widget in customtkinter and the appearance of the widget is not as per the specification. Below mentioned is the code snippet and the necessary imports.
import tkinter as tk
from tkinter import ttk, filedialog
from tkinter import Checkbutton
from tkinter import messagebox, LabelFrame
import sqlite3
import sqlite3 as db
import pandas as pd
from tkinter.ttk import Treeview, Combobox
from typing import Tuple
import jinja2
import PyPDF2
import tkcalendar
import ttkbootstrap as tbs
from tkcalendar import DateEntry
from datetime import datetime
import openpyxl
from docx import Document
from docxtpl import DocxTemplate
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
import json
import os
import time
import customtkinter as ctk
from customtkinter import CTkOptionMenu
Function to create a Cloud Storage bucket
ctk.set_appearance_mode("System") # Modes: system (default), light, dark
ctk.set_default_color_theme("green") # Themes: blue (default), dark-blue, green
frame9 = ctk.CTk()
frame9.title("OE APPLICATION WELCOME")
frame9.geometry("900x450+200+100")
frame9.configure(fg_color='white') # Set the default foreground color
frame9.resizable(True, True)
label1 = ctk.CTkLabel(frame9, text='Welcome. Please Register Yourself', text_color='black',
font=('Times New Roman', 20, 'bold'))
label1.place(x=255, y=10)
Label 2: Service Number
label2 = ctk.CTkLabel(frame9, text='Your Service Number', width=50, text_color='black', bg_color='white')
label2.place(relx=0.3, y=50)
entry2 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry2.insert(0, 'MS16866Y')
entry2.place(relx=0.5, y=50)
Label 3: Rank
label3 = ctk.CTkLabel(frame9, text='Rank', width=50, text_color='black', bg_color='white')
label3.place(relx=0.3, y=80)
entry3 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry3.place(relx=0.5, y=80)
entry3.insert(0, 'Lt Col')
Label 4: Name
label4 = ctk.CTkLabel(frame9, text='Name', width=50, text_color='black', bg_color='white')
label4.place(relx=0.3, y=110)
entry4 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry4.place(relx=0.5, y=110)
entry4.insert(0, 'Vineet Vishwakarma')
Label 5: Speciality
label5 = ctk.CTkLabel(frame9, text='Your Speciality', width=50, text_color='black', bg_color='white')
label5.place(relx=0.3, y=140)
entry5 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry5.place(relx=0.5, y=140)
entry5.insert(0, 'Gd Splt (Medicine)')
Label 6: Sub-speciality
label6 = ctk.CTkLabel(frame9, text='Your Sub-speciality', width=50, text_color='black', bg_color='white')
label6.place(relx=0.3, y=170)
entry6 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry6.place(relx=0.5, y=170)
entry6.insert(0, 'Cardiology')
Label 7: Unit
label7 = ctk.CTkLabel(frame9, text='Your Unit', width=50, text_color='black', bg_color='white')
label7.place(relx=0.3, y=200)
entry7 = ctk.CTkEntry(frame9, width=200, font=('Times New Roman', 14), text_color='blue', fg_color=('white', 'pink'), bg_color='pink', corner_radius=20)
entry7.place(relx=0.5, y=200)
entry7.insert(0, 'MH Jabalpur')
My issue is that the text_colour is black despite choosing different colour. the fg_color shows pink only on the outline and the entry has a separate rectangular entry box containing the text.
Beta Was this translation helpful? Give feedback.
All reactions