Why does toga lack events for a large number of widgets other than Button? #2141
Replies: 1 comment 17 replies
-
I'm not exactly sure I understand what the question is. It feels like you've asking for a feature that is currently missing... but I can't work out from your description what that need actually is. It might be something to do with mouse press events... but you haven't really explained what it is that you want to do that you can't do. If you're comparing Toga with Tkinter... I'd argue that Toga is already superior to Tkinter. Tkinter doesn't have a web widget, or a canvas widget; and it's not ever likely to be available on iOS, Android, web, or text console - features that Toga has right now. Are there things you can do in Tkinter that you can't do in Toga? Sure. But I can tell you from experience that it will be a lot easier to add missing features to Toga than to add features than it will be to add missing features to Tkinter. If your suggestion is that Toga should be made a wrapper around GTK4 on all platforms... I guess you've never used GTK on any platform other that Linux. In my experience, GTK apps look awful on macOS, are only marginally better on Windows - and won't work on iOS, Android, web, or text console. The only one of those platforms that is even plausible as a future GTK target is web (and maybe Android). So this is a non-starter as well. If you've got a feature request, can I ask that you actually describe the feature request, rather than theorising about potential fantasy rewrites of Toga? |
Beta Was this translation helpful? Give feedback.
-
In my spare time, I watched local APIs for Android, Windows, and Linux. I found that many widgets of Toga, such as Box, ImageView, Label, etc., may not have been able to add click or long press events, perhaps because Linux PyGobject is using Gtk3.0. In Gtk3.0, button can use signals to trigger events normally, but many other widgets can only be added to EventBox() to trigger events. That is, these widgets can have events,but they are no longer themselves,instead become EventBox objects. Therefore when Toga uses local APIs to add events to these widgets, it will cause problems, and ultimately, toga give up the events of those widgets, right?
But one difficulty with Python is mainly in mobile applications. If Toga's goal is to make Python apps run better on various platforms(desktops and mobile), The Desktop OS can be based on Python's built-in TKinder (which is converted to Toga code). TKinder is lightweight and stable, and it is well adapted to various system platforms on the desktop end. Then Toga can focus on the most promising intelligent mobile terminals in the future, and Toga can have a better set of code to unify the operation of various desktops and mobile platforms, and it is easier to maintain. Alternatively, Toga may follow the previous approach, and Toga's local API for Linux may be based on PYGobject GTK4.0 in the future, which is more user-friendly and allows widgets to easily add events without the need to use EventBox() to change themselves.
The above is my thoughts on Toga after studying it and the local APIs of various operaitting systems. I don't know if my ideas are appropriate. I really like Toga and hope it gets better and better.
Beta Was this translation helpful? Give feedback.
All reactions