UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Could I compile a python GTK appeared for Ubuntu touch?

    Scheduled Pinned Locked Moved App Development
    python
    6 Posts 5 Posters 1.3k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • C Offline
        ComLarsic
        last edited by

        Hello everyone!
        I am sorry if this is the wrong place for this question.

        I have created a simple web browser in python using PyGoObject, GTK and Webkit2

        I am looking to port it to ubuntu touch, however I can't find any information anywhere about it.

        Is it possible to build a GTK python appeared for UBtouch?

        1 Reply Last reply Reply Quote 0
        • CiberSheepC Offline
          CiberSheep
          last edited by

          Hello.
          Here you have the documentation: https://docs.ubports.com/

          GTK is not bundled in the system image. We use Libertine for desktop apps, I don't know if that could help. But looks like you might need to include all libraries you are using in the click.

          I hope that helps you getting started

          Another planet, another time, another universe!

          C 1 Reply Last reply Reply Quote 0
          • C Offline
            ComLarsic @CiberSheep
            last edited by

            @CiberSheep Ah, thank you! I'll look into libertine then 🙂

            1 Reply Last reply Reply Quote 0
            • dobeyD Offline
              dobey
              last edited by

              You don't need libertine. You would however need to include the dependencies in the click package, and support scaling properly in your app, to have it work as a "native" app, though currently GTK+ apps will probably not work so well.

              R 1 Reply Last reply Reply Quote 0
              • R Offline
                RandomUser @dobey
                last edited by

                @dobey I only came across it recently and haven't looked into it properly, but does that mean that we can develop in Python+GTK with libhandy widgets?

                1 Reply Last reply Reply Quote 0
                • J Offline
                  johndoe
                  last edited by johndoe

                  Packaging a GTK app as an click package is possible, but I could only manage to do so by giving the app special permissions (so this is a workaround and will most likely not be excepted in the official app store). Here is an example that worked on my Nexus 4 with Mir as the display manager and will maybe also work on other devices:
                  Video of working app (a simple image editor):
                  https://libre.video/videos/watch/2f2c5304-d278-4b43-84e0-3c463d3a6432
                  Source Code:
                  https://gitlab.com/AdamSchrey/image_and_buttons

                  Some of the things done here will maybe not be necessary on some devices or in future versions of Ubuntu Touch.

                  I had to add this lines to the .desktop file:
                  X-Ubuntu-Touch=true
                  X-Ubuntu-XMir-Enable=true

                  I had to add this line to the .apparmor file:
                  "template": "unconfined",

                  Otherwise I would get this error:
                  ** (process:26446): WARNING **: Unable to exec '/usr/lib/arm-linux-gnueabihf/ubuntu-app-launch/xmir-helper image-and-buttons_0.9.0 ut_session.sh' in '/opt/click.ubuntu.com/.click/users/phablet/image-and-buttons': Permission denied

                  I had to export this variable to get bigger buttons/text/entries...:
                  export GDK_SCALE=2

                  To get an on screen keyboard I installed this packages on my device:
                  maliit-inputcontext-gtk3 maliit-inputcontext-gtk2

                  ...and exported this variable:
                  export GTK_IM_MODULE=maliitphablet

                  I reply to this old post, because when I searched for a solution, this was one of the first things that came up and I could not find any working examples my self.
                  Maybe someone will find this helpful or will tell me if my app and my solution also work on other devices.

                  iab_ut.png

                  Some of the things I did, were taken from this website:
                  http://kriscode.blogspot.com/2016/09/x-applications-on-ubuntu-phone.html

                  1 Reply Last reply Reply Quote 3
                  • First post
                    Last post