How to remove the balls that appear in the kivy window? - python-3.x

I was wondering if it is possible, I believe so, removes the balls that appear in the window of the kivy when I click on it with the right button. It seems to me that it is a pattern, and I see no use.
I think it's a simple thing to solve...
I also have another question, and not to need to post a new question, here goes.
Let's assume I made a kivy window without borders:
from kivy import Config
Config.set('graphics', 'borderless', '1')
Now my doubt. How do I move the window by dragging the mouse?

Place this code at the top of your main .py file:
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,disable_multitouch')
See the documentation.

Just left-click on the ball you want to remove

Related

pyqt5 permanent widget focus

in my pyqt5 application, I have a QLineEdit that can have its value changed by both typing and pressing buttons that have advanced actions on the QLineEdit's text.
I have done some research and found the setFocusPolicy, but it does not have a permanent focus option, is there a way around this?
edit: by "permanent focus" I mean that the QLineEdit is always in a focus state where one can type into it, but clicking somewhere else or tabbing does not change the focus to a different widget
musicamante had it right, what I did was add a corresponding *widgetObject*.setFocusPolicy(Qt.NoFocus) line for each of my widgets that could possibly focus
note: I had this import line specifically for the NoFocus constant
from PyQt5.QtCore import Qt

Why does a borderless Kivy Window shift content down and to the right?

Using Kivy, I want to remove the default border from the App window (removing the close, minimize and maximize buttons). Based on the Kivy docs, I want to set the borderless value of my Window to True. However, doing so moves the content of my window down and to the right, exposing the black background color on the top and left sides of the window.
Screenshot of Window with borderless=False
Screenshot of Window with borderless=True
In the above images, the white within the window is coming from the Window.clearcolor, and the black in the borderless=True image is what I want to remove, or overlay with the rest of my content.
In the following snippet I have removed all the code that makes up the inner widgets of the kivy App, replacing them with an empty GridLayout to show where the content will be.
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
class MyApp(App):
def build(self):
self.title = 'My App'
Window.clearcolor = (1, 1, 1, 1)
Window.size = (300, 430)
Window.borderless = True # This is what is being changed
return GridLayout()
if __name__ == '__main__':
MyApp().run()
I have read the answers to similar questions regarding removing the default Kivy window border and how to position a borderless Kivy window.
Can anyone help diagnose how to shift the contents of my window back to the upper left corner when borderless is set to True?
Note: This is my first Stackoverflow question, please let me know how to improve it if need be!
Well, I'm not sure what the exact issue was, but after troubleshooting several different things within PyCharm (where my original project files were held), on a whim I tried opening the same project with Sublime and the issue is no longer present. When I run the identical code in Sublime, I get the intended result:
Beautiful! Just how I wanted it. =) I'm sure I somehow goofed up the Kivy settings in Pycharm somehow without realizing it, maybe something with the builder strings? I'm honestly at a loss. But I suppose if by any off chance someone else comes across this, switch up your IDE for a clean slate and give it another go.

How can I drag a borderless Kivy window

Let's assume I made a kivy window without borders:
from kivy import Config
Config.set ('graphics', 'borderless', '1')
After that, it is no longer a pattern to be able to move the window with the drag of the mouse.
Now my doubt. How do I move the window by dragging the mouse?
There is a module in kivy, called MotionEvent, but I don't know how to use it for my purpose.
Is there a function, which I can always call when I click and drag the window, causing each pixel dragged to call the function, iterating Values ​​over the window position? Or a better way
You can probably set kivy.core.window.Window.pos, that might be compatible with coding up a dragging behaviour but I don't know how well it will work.

Programmatically make app FULL SCREEN in PySimpleGUI

How to make PySimpleGUI app to be open in full screen, what I mean taking up the entire screen, not even leaving the task bar at the bottom of the screen?
This app will be running on Debian 8.
How to do this?
[EDIT May 2021 - This is an old answer. The method naming is different now. The coding conventions have changed. The documentation and examples on the PySimpleGUI GitHub have all been updated, bu StackOverflow of course has not. The result is that if you're copying code from StackOverflow, you're instantly behind. You're missing out. It'll run because PySimpleGUI is highly backward compatible, but it's not the recommended calls anymore]
Call window.Maximize() to make your window maximized as if you clicked on the titlebar to make it full screen. There are no parameters.
Make sure your window is fully created by adding .Finalize() to the end of your Window creation call like this:
window = sg.Window('Window Title', layout).Finalize()
window.Maximize()
If you want nothing at all showing except your application, then turn off the titlebar, set location = (0,0) and size=(width, height) of your screen. It won't hurt to turn on the keep_on_top parameter, unless you're planning on multiple windows.
Something like this (change the size to match your screen):
window = sg.Window('Window Title', layout, no_titlebar=True, location=(0,0), size=(800,600), keep_on_top=True)
We can also fix this problem by giving parameter 'resizable' to 'True'.
window = sg.Window('Window Title', layout, resizable=True)

Python: Click by coordinate inside a window

The goal of the program i'm trying to write is a bot that can click and play flash games and press keys inside a window webpage even when I do not have the window selected. My question is very similar to this. What I want to know is how to use win32, selenium, and PIL to take screenshots, analyze the screenshots, and click and press buttons accordingly from the bot. I've looked through the win32api documentation and found little about how to click inside a window in the background.
If someone could give a link to someone who has done this before or just a little nudge in the right direction would be amazing!
pywinauto is even simpler, but it may not recognize Flash controls. The code should just look a bit shorter:
import pywinauto
app = pywinauto.Application().connect(path='process_name.exe')
app.MainDialog.click_input(coords=(953, 656))
To check which controls are visible:
app.MainDialog.print_control_identifiers()
P.S. If you work with Python 3.x, this clone is compatible with Py3.
If your goal is detecting and interacting with images on screen, you might want to take a look at Sikuli. This is exactly what it does. Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is especially useful when there is no easy access to a GUI's internal or source code. More info here.

Resources