ParthJadhav / Tkinter-Designer

An easy and fast way to create a Python GUI 🐍
BSD 3-Clause "New" or "Revised" License
8.98k stars 823 forks source link

Error if the button have no fill #142

Closed Qiming-Liu closed 2 years ago

Qiming-Liu commented 2 years ago
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 commented 2 years ago

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 commented 2 years ago

I would also request you to test https://github.com/ParthJadhav/Tkinter-Designer/pull/132 as it's related to similar problem.

Qiming-Liu commented 2 years ago

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.