alejandroautalan / pygubu-designer

A simple GUI designer for the python tkinter module
GNU General Public License v3.0
800 stars 98 forks source link

Preview of CustomTkinter (CTk) not working #192

Open SiL3NC3 opened 1 year ago

SiL3NC3 commented 1 year ago

Describe the bug When starting a Preview (F5), it is not coming up.

To Reproduce Steps to reproduce the behavior:

  1. Add a "CTk" widget
  2. Press "F5" >> nothing happens
  3. Add a "CTkToplevel" widget
  4. Press "F5" >> Preview window pops up, as expected

Expected behavior Preview should also be working with CTk. ;)

Your Environment (please complete the following information):

Additional context Just a hint, add a button to the about dialog to copy out these info for bug reports. Is always a good feature. ;)

alejandroautalan commented 1 year ago

Hello @SiL3NC3, thanks for the report.

It seems to happen on windows OS. On Linux the screen is shown but with some errors in the background.

F5 preview is trying to execute the real code (and not fake previews like the design window). The problem here is that Ctk is another Tk window, with its own TCL interpreter running on background, and some things get not initialized for customtkinter.

I will try to figure out how to display the preview correctly.

Regards

alejandroautalan commented 1 year ago

I found a workaround, make sure you have checked "Center toplevel preview window" option in preferences dialog.

2023-02-18_22-48

Note that, if you see the preview, some issues will still happen because of the problem described above, For example, images might not be visible on the preview.

Try it and let me know.

Regards Alejandro A.

SiL3NC3 commented 1 year ago

Yes, with the above setting the preview is coming up and images are missing. Just a label text is shown.