Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if the button have no fill #142

Closed
Qiming-Liu opened this issue Sep 26, 2021 · 3 comments
Closed

Error if the button have no fill #142

Qiming-Liu opened this issue Sep 26, 2021 · 3 comments

Comments

@Qiming-Liu
Copy link

download_image(image_url, image_path)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\tkdesigner\utils.py", line 20, in download_image
    response = requests.get(url)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\sessions.py", line 456, in prepare_request
    p.prepare(
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "C:\Users\pross\scoop\apps\miniconda3\current\lib\site-packages\requests\models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

I got this output when I was trying to add a blank button.
image
But it works when I set the button like this
image

This seems a really ez bug to fix and if you need help I would like to help.

And another thing is that:
If the button is too large, it seems to create white margins on the top and bottom. (This is why I try to use a blank button)

@ParthJadhav
Copy link
Owner

Hmm, I see.

We need to fix one problem here and add one feature.

The problem is the white margins and the feature is - Ability to add blank buttons.

Currently when the program finds a button then it tries to get its exported image. But when the button is blank then the API does not return any image :

{
  "err": null,
  "images": {
    "2:2": null
  }
}

This can be fixed by :-

if (err != null && images.id = null ){
    then just use coordinates instead of the image
}

But this will arise another problem. It will create an ugly white button which tkinter has by default.
If we are able to get transparent buttons working then it would solve all the problems and also add the feature as we discussed above. So the end goal of this issue might be to implement transparent buttons.

Currently this effect is achieved by using a backdrop for the button which matches the background behind the button. And so making it look like the button is transparent. But in reality it just looks like it is.

I would be great if you can help us solve this issue. I would also look into it.

@ParthJadhav
Copy link
Owner

I would also request you to test #132 as it's related to similar problem.

@Qiming-Liu
Copy link
Author

Hmm, I see.

We need to fix one problem here and add one feature.

The problem is the white margins and the feature is - Ability to add blank buttons.

Currently when the program finds a button then it tries to get its exported image. But when the button is blank then the API does not return any image :

{
  "err": null,
  "images": {
    "2:2": null
  }
}

This can be fixed by :-

if (err != null && images.id = null ){
    then just use coordinates instead of the image
}

But this will arise another problem. It will create an ugly white button which tkinter has by default.
If we are able to get transparent buttons working then it would solve all the problems and also add the feature as we discussed above. So the end goal of this issue might be to implement transparent buttons.

Currently this effect is achieved by using a backdrop for the button which matches the background behind the button. And so making it look like the button is transparent. But in reality it just looks like it is.

I would be great if you can help us solve this issue. I would also look into it.

Yeah, transparent buttons is the key, i

Hmm, I see.

We need to fix one problem here and add one feature.

The problem is the white margins and the feature is - Ability to add blank buttons.

Currently when the program finds a button then it tries to get its exported image. But when the button is blank then the API does not return any image :

{
  "err": null,
  "images": {
    "2:2": null
  }
}

This can be fixed by :-

if (err != null && images.id = null ){
    then just use coordinates instead of the image
}

But this will arise another problem. It will create an ugly white button which tkinter has by default.
If we are able to get transparent buttons working then it would solve all the problems and also add the feature as we discussed above. So the end goal of this issue might be to implement transparent buttons.

Currently this effect is achieved by using a backdrop for the button which matches the background behind the button. And so making it look like the button is transparent. But in reality it just looks like it is.

I would be great if you can help us solve this issue. I would also look into it.

Yep, cross-platform transparent buttons are the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants