alejandroautalan / pygubu

A simple GUI builder for the python tkinter module
MIT License
2.01k stars 213 forks source link

py2app (macOS) #252

Closed txbugeater closed 2 years ago

txbugeater commented 2 years ago

Hi Alejandro,

I enjoyed using your tool you created. It is great for a newbie in gui app designing in python. I attempted to make a standalone app using the py2app utility. Unfortunately there appears to be a problem (It certainly could be an issue with py2app), but the failure occurs when it tries to launch pygubu the builder.get_object('main window', master) of the helloworld.py demo.

I would be happy to share the output if you are interested.

For now, I won't be able to more forward with pygubu as a means to deliver a simple utility for my customer, so I plan to just hand roll my app. Its very small so it shouldn't take too long. But I would much rather use bygubu!

alejandroautalan commented 2 years ago

Hello @txbugeater, thanks for trying pygubu.

I would be happy to share the output if you are interested.

Yes, please let me see the errors.

I managed to try py2app and make the helloworld example work. Here is what I found:

Add .ui file to the DATA_FILES variable:

"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

APP = ['helloworld.py']
DATA_FILES = ['helloworld.ui']
OPTIONS = {}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

Add the pygubu package when generating the application:

python3 setup.py py2app --packages pygubu

Let me know if this helps.

Regards Alejandro a.

txbugeater commented 2 years ago

Sent with ProtonMail Secure Email.

------- Original Message ------- On Tuesday, February 15th, 2022 at 6:32 PM, Alejandro Autalán @.***> wrote:

Hi Alejandro, Thank you for the quick response! I just tried your recommendation and it works! Now I will try it on my app. I suspect it will work or at least get me further down the road.

I had used the packages --command but not with just pygubu as you showed. I think I used a package path that the error output was complaining about. It was an inner pygubu package I believe.

Sincerely,

Dan

Hello @.***(https://github.com/txbugeater), thanks for trying pygubu.

I would be happy to share the output if you are interested.

Yes, please let me see the errors.

I managed to try py2app and make the helloworld example work. Here is what I found:

Add .ui file to the DATA_FILES variable:

"""

This is a setup.py script generated by py2applet

Usage:

python setup.py py2app

"""

from

setuptools

import

setup

APP

=

[

'helloworld.py'

]

DATA_FILES

=

[

'helloworld.ui'

]

OPTIONS

=

{}

setup

(

app

=

APP

,

data_files

=

DATA_FILES

,

options

=

{

'py2app'

:

OPTIONS

},

setup_requires

=

[

'py2app'

], )

Add the pygubu package when generating the application:

python3 setup.py py2app --packages pygubu

Let me know if this helps.

Regards Alejandro a.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>