jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 67 forks source link

Changing cursor color in a text input box #614

Open lowcam opened 4 years ago

lowcam commented 4 years ago

Bug Report


Sorry, this isn't truly a bug report. I just couldn't find this information on the appJar.info site. I was wondering if there was a way to change the color of the cursor in a text input box.

Context


I am designing an app and have both a light version and a dark version. In the dark version, with dark backgrounds and light foregrounds, the cursor does not change colors and remains black. This makes selecting text difficult because I can't see where the cursor is.

Expected Behaviour


Be able to change the color of the flashing cursor to a lighter color.

Actual Behaviour


The cursor remains black which makes it hard to find with a dark background.

Any error messages produced by appJar


None

Sample code, demonstrating the issue


app.addLabelEntry("TextString") app.setEntryBg("TextString","#0F2439") app.setEntryFg("TextString","#9d968d")

What steps are needed to reproduce the bug


Use the above code, enter text into the text box, and try to find the cursor.

Version Information


Replace this with the result of running your code with the -v flag: python myCode.py -v appJar: 0.94.0 Python: 3.7.6 TCL: 8.6, TK: 8.6 Platform: Windows pid: 2144 locale: en_US dark_text_box

jarvisteach commented 4 years ago

Anything that's possible in Tkinter is possible in appJar!

I don't this is a config option that has been exposed through the appJar interface yet, so you'll have to use a Tkinter command on the widget.

e = app.entry('Name:', label=True, bg='black', focus=True, fg='white')
e.config(insertbackground='red')
jarvisteach commented 4 years ago

Or, do it in one line:

app.entry('Name:', label=True, bg='black', focus=True, fg='white').config(insertbackground='red')