user interface – Add a widget on the mouse pressed in the GUI – kivy python

I have problems adding and displaying an image to the layout each time I press the screen using the mouse.

Myszka class (ClickAndGo, Widget):

def on_touch_down (auto, touch):
Great (). build ()
flaga_path = os.path.join (self.img_path, "test.png")
x, y = touch.pos
self.flaga = Image (source = float_path, size_hint = (None, None), size = (64, 64),
pos = (round (x, 1), round (y, 1)))
self.camlayout.add_widget (self.flaga)
print (touch.pos)
  • Current results:
    only the touch position is printed, the image has not been displayed.
  • Expected results:
    The image should have been displayed each time the mouse is lowered.

ios – The button does not hide when the button is pressed

I arrive at a problem where I have a button called checkInbtn where I want to hide it when you press a button. But for some reason, the checkInbtn appears when my other button appears. I've tried debugging, and nothing useful comes up. Anyone can help me solve this problem. Thanks for the help.

import UIKit

CheckInViewController class: UIViewController {
@IBOutlet low var checkInbtn: UIButton!
@IBOutlet low var timerLeft: UILabel!
@IBOutlet low checkOutBtn: UIButton!

var seconds = 0
var timer = Timer ()
var isTimerRunning = false

replace func viewDidLoad () {
super.viewDidLoad ()

checkOutBtn.isHidden = true
timerLeft.isHidden = true
}

@IBAction func checkInBtnWasTapped (_ sender: N any) {
runTimer ()

checkOutBtn.isHidden = false
timerLeft.isHidden = false

checkInbtn.isHidden = true
}

@IBAction func checkOutBtnWasTapped (_ sender: N any) {
if timer! = nil {
timer.invalidate ()
}

checkInbtn.isHidden = true
checkOutBtn.isHidden = true
timerLeft.isHidden = true

let alert = UIAlertController (title: "Preview", message: "You have been checked out", preferredStyle: .alert)

alert.addAction (UIAlertAction (title: "OK", style: .default, manager: nil))

self.present (alert, animated: true)
}

func runTimer () {
timer = Timer.scheduledTimer (timeInterval: 1, target: self, selector: (#selector (CheckInViewController.updateTimer))), userInfo: nil, repeats: true
}

@objc func updateTimer () {
seconds + = 1
timerLeft.text = " (seconds)"
}
}

In a python calculator, how do I create a button that, when pressed, enlarges the letter of all buttons?

I need all the letters to increase, including the same button.
And then a button that does the opposite process: decreases the size of the sources.

macbook – "t" key still pressed on mac

For some reason, my Mac keyboard still thinks that the "t" key is still depressed. However, as you can see, I can still type the letter t, but its output is delayed compared to the other keys. I think this is a software bug because the key still works well, but on some pages, the t key is simply spammed. Curiously, shift + t will not give me a capital t, but all the other letters work well (and my capital lock has been converted to a backspace, so I can not test it (by choice)). this has already occurred before, but usually disappears after a reboot, but this time, a reboot did not help.

Edit: currently on Macbook Air (1 generation ago)

android – unknown ACTION of this NavController when the back button is pressed

I'm implementing the Navigation component in my project in Java.
I have 1 activity and several fragments. My first fragment (login) performs some validations on the employee information and redirects you to the fragment of the menu.

loginViewModel.statusAsignacion.observe (this, loginResult -> {
Log.d (TAG, "result =" + loginResult);
binding.textViewLoginError.setText (loginResult);
if (loginResult.equals (ASIGNACION_EXITOSA)) {
NavHostFragment.findNavController (this) .navigate (R.id.action_loginFragment_to_menuFragment); // this is line 92
}
});

The animation is done correctly and I enter the menu without problems, but when I press the back button, I get the error navigation destination xxxxxx: id / action_loginFragment_to_menuFragment is unknown for this NavController.

java.lang.IllegalArgumentException: navigation destination xxxxx: id / action_loginFragment_to_menuFragment is unknown for this NavController.
at androidx.navigation.NavController.navigate (NavController.java:803)
at androidx.navigation.NavController.navigate (NavController.java:744)
at androidx.navigation.NavController.navigate (NavController.java:730)
at androidx.navigation.NavController.navigate (NavController.java:718)
at com.wsircam.adn.mvvm.app.login.LoginFragment.lambda $ onViewCreated $ 1 (LoginFragment.java:92)

In my navigation graph, the action is defined.



    


unit – When the motion button is pressed, the shape of the character changes and always moves in the left direction

have a good day. When you press the motion button, the shape of the character changes and always moves in the left direction.

Why does this happen and what is the solution?

enter the description of the image here

enter the description of the image here

Press two buttons to move to the left and the shape changes.

using System.Collections;
using System.Collections.Generic;
use UnityEngine;

Public class PlayerKontrol: MonoBehaviour {

float public karakterHizi = 8f, maxSurat = 4f;
Private Rigidbody2D myRigidbody;
Private animator myAnimator;


private bool solaGit, sagaGit;

empty Awake () {
myRigidbody = GetComponent ();
myAnimator = GetComponent ();

}

void FixedUpdate () {
if (solaGit) {

SolaGit ();
}

if (sagaGit) {

SagaGit ();
}
}

AyarlaSolaGit (bool solaGit)
{
this.solaGit = solaGit;
this.sagaGit =! solaGit;
}

public void HareketiDurdur () {
solaGit = sagaGit = false;
myAnimator.SetBool ("run", false);
}

void SolaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = -0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

void SagaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = 0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

}

After installing lubuntu in my computer, I restarted it. He showed a black screen after startup. Then I pressed Ctrl + Alt + F1. So what should I do?

![My pc::- pentium 4, 2gb ram, 32 bit, currently no OS]
After installing Lubuntu 14.04.5 from bootable usb, I found myself stuck after startup. I pressed the CTRL + ALT + F1 key combination. But being beginner, I do not know what to do ?? Plz help me !!
Text displayed ——-

lubuntu @ lubuntu: ~ $

16.04 – The Rhythmbox music player opens when the arrow keys (up, down, right, left) are pressed

Rhythmbox Music Player opens when you press the arrow keys (up, down, right, left). For now, only restarting the machine can prevent this strange behavior.

Can someone let me know the permanent fix for this other than rebooting the machine ?.

Thanks in advance.

Android Studio? How long is a key pressed?

I was trying to develop a basic application and wanted to add how long a key can be pressed. In fact, I try to create a little game.
I just want to know that how can I detect in android studio that the time during which the key is pressed. However, do not press the key and several times the entry should not be given. Once pressed, the Android studio must start calculating the time from the beginning, until the key is pressed until it is released.
Any idea related to this and if code could be given would be helpful.
Thank you:)

What code do I have to add to rotate the characters according to the keys pressed? [on hold]

body {background: url (https://www.dreamincode.net/forums/uploads/post-242958-1246321970.jpg&#39;); size of the bottom}

myChangeImage01 () {function
}
{document.body.style.backgroundRepeat = "no-repeat";}

document.onkeydown = checkKey;
checkKey function (myEvent) {
if (myEvent.keyCode == 87) {document.getElementById (myImage01 & # 39;)). style.top =
parseInt (document.getElementById ("MyImage01"). style.top) – 13 + & # 39; px & # 39;
// up
if (myEvent.keyCode == 83) {document.getElementById (<myImage01>). style.top =
parseInt (document.getElementById ("myImage01"). style.top) + 13 + & # 39; px & # 39; // Down
}
if (myEvent.keyCode == 68) {document.getElementById (myImage01 & # 39;)). style.left =
parseInt (document.getElementById (& # 39; myImage01 & # 39;). style.left) + 13 + & # 39; px & # 39; // Right
document.getElementById (& # 39; myImage01 & # 39;). style.transform = rotation (360deg) & # 39;
if (myEvent.keyCode == 65) {document.getElementById (& myImage01). style.left =
parseInt (document.getElementById (& # 39; myImage01 & # 39;). style.left) – 13 + & # 39; px & # 39; // left
}}