I want to make my Entry box without any color and only shows the cursor so it will blend with the canvas image. Here is what I want to make objective design and here is what I am able to make current design.
I did try the root.wm_attributes("-transparentcolor", "yellow") but it will also make the frame invisible. How do I make the entry box transparent without affecting the background. My code is based on the link below.
https://github.com/ajinkyapadwad/Tkinter-HosoKeys
Related
I have a label that is the background image and a frame on that label that shows other images and buttons, but I have some white spaces. Is it possible to make those spaces transparent to show the background image?
I've tried making the background a color and making that color transparent with:
window.attributes("-transparentcolor", "#20fc03");
frame.configure(background="20fc03");
but it makes the whole window transparent showing my desktop.
I can provide code if needed, I just do not know what would be useful.
Recently i've been trying to make a simple GUI with tkinter in python
but for some reason the background color doesn't fully fill the window with the specific color
eg:
How do i fill all the sides?
Any replies are greatly appreciated ;-)
First of all, you need to also attach a minimal reproducible example. Nevertheless, I think you have put a canvas with the colour you want and expanded it to 1.
Canvases in Tkinter always have a border like thing. Rather you can use a frame with the same colour (instead of the canvas) and the border will disappear. The other option is to configure your root to have its own colour like such:
root.config(bg='red')
Either way, you will have to then delete your canvas and place its widgets into either the frame or the root itself.
If this works, please accept this answer. Hope it was helpful. Thank you!
I want to make a drag and drop interface for my chess game in tkinter but for this the background of the tkinter widget has to be transparent. How can I achieve this? I know that you can use root.wm_attributes("-transparentcolor", "somecolour") to make the background fully transparent. However, in my case this means that you can see past the board and outside of tkinter. What I want is to be able to see the colours of the chess board behind the piece when I am moving it.
I'm developping a text editor with PyQt5 and I want to create my own "title bar".
I've created my own title bar and I have something just like the image above. The only problem is the window's frame. So far I've been using:
setWindowFlags(Qt.FramelessWindowHint)
But I just realised that with this flag there is no frame (cause it's "Frameless") and without the frame I can't resize my window by dragging the border.
I've tried CustomizeWindowHint flag but the title bar is still there, just without icon, name and buttons.
A temporary solution is to detect whenenver the mouse enter the window by installing eventFilter, get its positions, if it's on the border then we have to change the cursor icon (up, left, down, left-up, left-down,...) and if the user drags then calculate and resize window.
Another solution is to set 8 QSizegrip at every corner of the window but we will have to somehow hide those grips and make sure that they don't take any space because we will add 3 grips at the TOP of the title bar so it will be ugly.
But I don't really like these solutions. So is there anyway that I can hide the title bar and keep the frame?
What the title says.
I'm having a problem moving the textbox from a side to side.
The code's long and it's about 200+ lines so I wont post it here.
Anybody has an idea?
You have various options for this, depending on what you mean by "text box," and whether you want to move it "by pixels" or "from a side to [another] side."
If you just want to display text, you can use a Label widget. If you want a text box where the user can enter text, try an Entry widget. If you want to move your widget from one area of the screen to another, you can use the grid geometry manager and simply use grid_forget to "unplace" your widget then grid (with different options than you originally used, of course) to put it somewhere else.
If you just have text and you'd like to move it pixel by pixel, you could create a Canvas and then use that widget's create_text method to create some text in a specific place on the Canvas. You can the use the Canvas widget's itemconfig method to move the text to a new location.
If you need something more complex than text, like an Entry widget, and you want to move it pixel by pixel, do the same as above but use the create_window method instead.
See Canvas, grid, Label, Entry, and these SO questions about create_window.