-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntryBox.py
More file actions
35 lines (28 loc) · 1.18 KB
/
EntryBox.py
File metadata and controls
35 lines (28 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import tkinter as tk
from tkinter import *
from PIL import ImageTk, Image
#Custom Entry fields [Credits:- User form StackOverflow]#
class Entry(tk.Entry):
def __init__(self, master=None, **kw):
super().__init__(master, **kw)
self.config(state='disabled', disabledforeground='white', disabledbackground='black', bg="black", fg="white")
def insert(self, pos, value):
self.config(state='normal')
super().insert(pos, value)
self.config(state='disabled')
def delete(self, pos, value = END):
self.config(state='normal')
super().delete(pos, value)
self.config(state='disabled')
class OPEntry(tk.Entry):
def __init__(self, master=None, **kw):
super().__init__(master, **kw)
self.config(state='disabled', disabledforeground='cyan', disabledbackground='#353340', bg="black", fg="white")
def insert(self, pos, value):
self.config(state='normal')
super().insert(pos, value)
self.config(state='disabled')
def delete(self, pos, value = END):
self.config(state='normal')
super().delete(pos, value)
self.config(state='disabled')