I'm using a wxpython textctrl & would like to hide the caret. After a lot of searching it would appear that the best approach would be to simply change it's colour to white. However I can not work out how to do this.
I found the following info:
SetCaretForeground(fore)
Sets the foreground color of the caret. The parameter fore is a wxColour object, a #RRGGBB string, or a color spec like "white". Returns None.
from here: http://www.yellowbrain.com/stc/caret.html#setfg
The code for my current textctrl is below. Any help would be appreciated.
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL)
Clinton.
You are using a wx.TextCtrl and the link you give is for a wx.StyledTextCtrl. These are completely different animals, and the wx.StyledTextCtrl has a lot more functionality than the simple wx.TextCtrl.
I don't think there's a way to set the caret color in an ordinary wx.TextCtrl.
Related
This is a follow up question to Change the color of the type hint in coc.nvim's rust-analyzer
I'm wondering if it's possible to change the background color of inlay hints from Rust Analyzer in Vim. Adding a hex #ffffff00 doesn't seem to work, nor does just 0.
After some more experimenting I was able to find that if you just remove the option for a background color in the examples provided in the aforementioned question, it will not have a background as desired. For me, that looks like:
"For Types hint
hi default CocInlayHint ctermfg=71
The part to remove is ctermbg=0. I also removed other parts from the example provided but it seemed to have no effect so I've left them out here as well.
I have a little problem with bold and italic fonts in a plot at the same time.
I tried:
plt.text(0.5,0.5,r'\it{italic} + \bf{bold}' = \it{\bf{both}}')
this gives: italic and bold = both
and with:
plt.text(0.5,0.5,r'\it{italic} + \bf{bold}' = \bf{\it{both}}')
I get: italic and bold = both
But what I want to get is both
I also tried to use the latex version with \textbf{...} and \textit{...} and the commands \mathit{...} and \mathbf{...}.
They work as they should but not if they are used combined. The combination of different "technologies" like \mathbf{\textbf{...}} does not help. It is alway only the last style that stays.
I saw a few different questions on that topic but no correct answer, so I hope that asking espacially for this contextless case helps to find an answer. I am looking for a generall solution, not for a workaround for a special case, e.g. using a special font that already looks bold.
I have found the answer. Yoi have to use a different font. The work around I mentioned is the answer. If you use:
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
you will get the desired result. The default font in matplotlib seems to not support the bold and italic edits at the same time. Maybe this helps in many other situations you will have with other edits in case you are looking for different combinations.
I am trying to do some visualizing data on the terminal and I am doing lots of printing to do that. The issue I am having is that certain character symbols look the same. I figured that coloring them differently would help me see the differences. I see from this link that there is a way to do it, but I don't understand what I am looking at. There is no explanation for what is going on in those solutions.
How do you specify, in the same line, text with different colors?
I should also mention that I am building the printable string OUTSIDE of the call to print(). How do you build the colorful string outside of the print() call?
A rewritten form of my question:
1. Colorize the text I print to the string with multiple types of colors.
2. Colorize the string BEFORE it gets sent to the "print()" call.
A couple examples would be great.
Using colorama just like the answer you linked is doing:
from colorama import Fore, Style
my_str = f"{Fore.BLUE}Hello, {Style.RESET_ALL} guys. {Fore.RED} I should be red."
print(my_str)
This gives me:
As you can see Fore.<color name> changes the color of the text after it, until the Style.RESET_ALL. After that you can change the color of the text again.
There could be multiple ways to achieve this. One which doesn't require any extra packages is to use ANSI color codes. Look at this link. Below are some examples.
s = "\033[1;32;40m Bright Green on black \033[1;31;43m Red on yellow \033[1;34;42m Blue on green \033[1;37;40m"
print(s)
Here in first code \033[1;32;40m, \033[ is the escape code followed by 1 for bold, 32 for bright green text and 40 for black background. The 3 codes are separated by ; and ended with m. Adding all the 3 codes (1, 32 and 40 here) isn't mandatory though.
output:
Other ways to achieve this can be found here.
I've made a simple shape editor. I can change colors (used to fill shapes) by click on buttons in a menu bar. The disadvangate of this solving is the fact that the numbers of colors are so restricted. I can't find a better solution for my program. Can somebody help me and give me an idea how can I improve it? I thought about color palette, but I have no idea how can I do this.
The image:
("Aktywny kolor" means active colors, and there is the list of colors below, which I can use)
You would need to use a color picker where the colors are distributed on many pixels and not on a very small set of color names. Since you are using applet, you might want to download an already made color picker compatible with your environment, or you might want to write your own, depending on whether the things you find meet your expectations.
This image is from kitchensink, and the problems are :
Line through doesn't exactly at right place (see the left text at top)
When it's italic with background color, the text is a bit out of its background (see the left text at top)
Underline is a bit far from text, or can we adjust its distance?
Thanks.
You're seeing an experimental feature — fabric.IText — that's currently in development. It allows to edit text inline and supports partial formatting.
The problem with line-through is known.
Underline being far probably has to do with stretched text. When I load kitchensink it looks good.
Background and italics is an interesting one. I just checked google docs and there's the same problem there: