nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.52k stars 130 forks source link

AppKit backend (through PyObjC) for Enaml #538

Open acaland opened 7 months ago

acaland commented 7 months ago

Hello,

I am wondering if it would be possibile to use Enaml directly against AppKit (macOS only) I cannot find any documentation on how to integrate (or create) a new backend.

It seems that enaml-native use UIKit backend for iOS, but it uses a RPC-like bridge. Would it be better to use PyObjC for desktop apps?

MatthieuDartiailh commented 6 months ago

@frmdstryr would know more about the cost of the RPC-like bridge.

I do not have the bandwidth to develop a new backend and it would be quite complicated too since I do not own a mac. As for the alternative backend developed by @frmdstryr this endeavor can be undertaken outside of enaml.

frmdstryr commented 6 months ago

I don't see why it wouldn't work, Enaml can be used for any tree-like structure.

From a very high level to make a custom backend you need to create an Application subclass and change the resolver so it finds your custom widgets.

I made a simple gtk backend that hopefully is simple enough to show what is needed. enaml-gtk.zip