Coder Social home page Coder Social logo

forms-gtk-progress's Introduction

Xamarin.Forms GTK Backend

The purpose of this repository is show the status of the GTK backend of Xamarin.Forms. The GTK backend adds support for new platforms like Linux using Gtk#.

Gtk# is a Graphical User Interface Toolkit for Mono and .Net. The project binds the gtk+ toolkit and assorted GNOME libraries, enabling fully native graphical Gnome application development using the Mono and .Net development frameworks.

Xamarin.Forms GTK Backend
Xamarin.Forms.Platform.GTK
Xamarin.Forms GTK Backend Samples
Movies
Temperature Monitor
WeatherApp
Forms Embedding Gtk
XAML Live Editor
Microcharts GTK Samples (SkiaSharp)
Xamarin.Forms GTK Samples

Xamarin.Forms

Xamarin.Forms provides a way to quickly build native apps for iOS, Android, Windows, macOS and Linux, completely in C#.

Read more about the platform at https://www.xamarin.com/forms.

Status

Currently, the GTK Backend allows to develop applications, but it is still in development. If you want to know in detail the status, navigate to the Status section.

You could also see the section Pending & Known Issues.

Platform Support

The Xamarin.Forms GTK backend adds support for Linux, MacOS and Windows.

Roadmap

When will it be available?.

Gallery

GTK Backend

Looks good?. In the gallery section you have a huge variety of screenshots on different platforms (Linux, MacOS & Windows) and devices (Laptops, Desktops or Raspberry Pis).

Faq

Still with doubts or questions?. Do not worry, we have prepared a complete Faq answering the most common doubts.

Feedback

Please use GitHub issues for questions, comments, feature requests, or if would like to vote on what others are recommending.

How can I try?

If you want to try everything, let's see how to compile and test on each platform.

How to Contribute

Are you interesting?. You can contribute!.

forms-gtk-progress's People

Contributors

jsuarezruiz avatar mallibone avatar mirdaki avatar tuxuser avatar zeprogfactory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forms-gtk-progress's Issues

[BUG] GTK and Emoji ๐Ÿ’ฉ

I hope this is the correct place to report this.

I'm not shure if there is something I have to do differently?

Windows UWP works fine, but the GTK does not show the emoji correctly..:

poo

Custom toolbar renderer?

How to create a custom renderer for toolbars?
I want to change it's background, remove the title text and left-align items in the toolbar, I thought of creating a custom renderer for MasterDetailPage but I'm looking for a dedicated way to customize toolbars if there's any.

screenshot_20180815_183530

Screenshot taken from ArchLinux/KDE
Xamarin.Forms/3.0.0.446417
Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral

Linux GTK version

Could you please tell me which version of libgtk2.0 you are using under Linux? I use Ubuntu 16.04 and it was working before, but on another system which I thought was the same setup, I get an error that it fails to initalialize Pango.Layout because Glib.GType.GetClassSize() is not found. I use, as you said, gtk-sharp 2.12 and everything compiles fine. It starts and runs, but when something triggers that Pango.Layout init issue. The stacktrace tells nothing of what is actually happening.

Would you have any clue or can you tell me what versions you are using yourself under Linux?

ImageSource.FromStream() produces "Unrecognized image file format" from GDK

Trying to update an Image through a stream source with various permutations of code such as:

        SourceStream = new MemoryStream(buffer);
        Source = ImageSource.FromStream(() => SourceStream);

Where buffer is a simple byte[] containing pixel values.

This isn't working, but I get some curious errors in the output window:

[Image loading] Image load failed: GLib.GException: Unrecognized image file format
at Gdk.PixbufLoader.Write(Byte[] buf, UInt64 count)
at Gdk.PixbufLoader.LoadFromStream(Stream input, Byte[] streamingBuffer)
at Gdk.PixbufLoader.InitFromStream(Stream stream, Byte[] buffer)
at Gdk.PixbufLoader..ctor(Stream stream, Byte[] streamingBuffer)
at Gdk.Pixbuf..ctor(Stream stream)
at Xamarin.Forms.Platform.GTK.Renderers.StreamImagesourceHandler.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Xamarin.Forms.Platform.GTK.Renderers.ImageRenderer.d__5.MoveNext()

As near as I can tell, GDK expects streams to be actual valid image files, such as .png or .jpeg, while Xamarin's API is supposed to just pass around raw buffers wrapped in streams. This is either a Xamarin.Forms GTK bug, or else the documentation badly needs revision. Actually, the documentation needs revision anyway since the only information I can find about what you're supposed to pass in the source stream comes from various forum threads and mailing lists.

Installation with VS2019

Hello,
Is there any tutorial for step by step installation ?
I followed the Xamarim.Forms GTK setup tutorial, with GameOfLife demo. Thank you !

VS2019 Community 16.6.2, Xamarin.Forms & Xamarin.Forms.Platform.GTK 4.7.0.968 & GTK# 2.12 on Windows 10 x64 2004

Following the platform setup is leading to an error at build:
line 15 var app = new App();
namespace not found for App().

If i replace App() by Xamarin.Forms.Application(), it starts but throws a System.NullReferenceException at:
lien 21 Gtk.Application.Run();

Navigation in OnAppearing

When trying to navigate to another view in the OnAppearing method, the navigation does not take place if Navigation.PushModalAsync or will crash if Navigation.PushAsync is used.

Disable "Issues" tab and link to Xamarin.Forms repo?

Since it was mentioned that issues with Xamarin.Forms GTK are tracked on the main Xamarin.Forms, would it be an option to first transfer existing issues and then close the issues tab on here. It would greatly reduce confusion on that matter.

Still active, of course. What happens is that the issues and PR are managed from the official repository of Xamarin.Forms: https://github.com/xamarin/Xamarin.Forms/pulls?q=is%3Apr+is%3Aclosed+label%3Ap%2Fgtk

Originally posted by @jsuarezruiz in #12 (comment)

[GTK] [Pango] [Raspberry Pi] Background task is crashing

I made a simple program displaying the current time:

         Device.StartTimer(new TimeSpan(0, 0, 1), () =>
         {
            // do something every 1 seconds
            Device.BeginInvokeOnMainThread(() =>
            {
               // interact with UI elements
               label.Text = DateTime.Now.ToString("HH:mm:ss");

            });

            return true; // runs again, or false to stop
         });

The program is running for about 15 minutes without problems

before crushing:

free(): invalid pointer
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Pango.FontDescription.pango_font_description_free (intptr) <0x00037>
  at Pango.FontDescription.Free (intptr) [0x00000] in <b785bf3027ba4410ae7cbbd62d603584>:0
  at GLib.Opaque.set_Raw (intptr) [0x00033] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.Opaque.PerformQueuedFrees () [0x00054] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.Timeout/TimeoutProxy.Invoke (intptr) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.SourceProxy.HandlerInternal (intptr) [0x00002] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at (wrapper native-to-managed) GLib.SourceProxy.HandlerInternal (intptr) <0x00073>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00033>
  at Gtk.Application.Run () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
  at Test.GTK.MainClass.Main (string[]) [0x00043] in <0cdcb7f5c60e423aa1e8a3b7f65e3344>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x0004e] in <0cdcb7f5c60e423aa1e8a3b7f65e3344>:0
/proc/self/maps:
00010000-003d7000 r-xp 00000000 08:02 1456761    /usr/bin/mono-sgen
003e6000-003ea000 r--p 003c6000 08:02 1456761    /usr/bin/mono-sgen
003ea000-003ee000 rw-p 003ca000 08:02 1456761    /usr/bin/mono-sgen
003ee000-00474000 rw-p 00000000 00:00 0 
00e9e000-01527000 rw-p 00000000 00:00 0          [heap]
b248c000-b249c000 rwxp 00000000 00:00 0 
b249c000-b251c000 rw-p 00000000 00:00 0 
b2524000-b25a8000 rw-p 00000000 00:00 0 
b25ac000-b25b2000 rw-p 00000000 00:00 0 
b25b4000-b25d4000 rwxp 00000000 00:00 0 
b25d4000-b25d6000 rw-p 00000000 00:00 0 
b25d8000-b25dc000 rw-p 00000000 00:00 0 
b25dc000-b25ec000 rwxp 00000000 00:00 0 
b25ec000-b25f0000 r-xp 00000000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b25f0000-b25ff000 ---p 00004000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b25ff000-b2600000 r--p 00003000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b2600000-b2601000 rw-p 00004000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b2601000-b2611000 rwxp 00000000 00:00 0 
b2611000-b2613000 r-xp 00000000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2613000-b2622000 ---p 00002000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2622000-b2623000 r--p 00001000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2623000-b2624000 rw-p 00002000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2624000-b2649000 r--p 00000000 08:02 269382     /usr/share/fonts/truetype/piboto/PibotoLt-Regular.ttf
b2649000-b2653000 r--s 00000000 08:02 915836     /var/cache/fontconfig/3e18a00a-59c6-4373-b1c9-32ba94e06564-le32d8.cache-7
b2653000-b2665000 r--s 00000000 08:02 915850     /var/cache/fontconfig/e193c6f4-6b1a-409f-86ed-d89899844414-le32d8.cache-7
Memory around native instruction pointer (0xb6ca6f24):
0xb6ca6f14  00 20 a0 e3 08 30 a0 e3 af 70 a0 e3 00 00 00 ef  . ...0...p......
0xb6ca6f24  04 21 9d e5 00 30 94 e5 0c 00 a0 e1 03 00 52 e1  .!...0........R.
0xb6ca6f34  08 00 00 1a 43 df 8d e2 f0 80 bd e8 24 30 9f e5  ....C.......$0..
0xb6ca6f44  00 20 60 e2 e8 ae ff eb 03 30 9f e7 00 c0 e0 e3  . `......0......

Native stacktrace:

Pkilling 0xb673f460 from 0xb6f21210
Entering thread summarizer pause from 0xb6f21210
Finished thread summarizer pause from 0xb6f21210.

Waiting for dumping threads to resume


Debug info from gdb:

[New LWP 3741]
[New LWP 3742]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
__waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id                                  Frame 
* 1    Thread 0xb6f21210 (LWP 3740) "mono"        __waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
  2    Thread 0xb5fff460 (LWP 3741) "SGen worker" futex_wait_cancelable (private=0, expected=0, futex_word=0x3f8c58) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  3    Thread 0xb673f460 (LWP 3742) "Finalizer"   0xb6e06088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0x3f0ee0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 3 (Thread 0xb673f460 (LWP 3742)):
#0  0xb6e06088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0x3f0ee0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x3f0ee0, abstime=0x0) at sem_waitcommon.c:115
#2  0xb6e061f4 in __new_sem_wait_slow (sem=0x3f0ee0, abstime=0x0) at sem_waitcommon.c:282
#3  0x00281488 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xb5fff460 (LWP 3741)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x3f8c58) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x0, cond=0x3f8c30) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x3f8c30, mutex=0x0) at pthread_cond_wait.c:655
#3  0x002ed600 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb6f21210 (LWP 3740)):
#0  __waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  __waitpid (pid=3774, stat_loc=0xbee93b48, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
#2  0x0010225c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
[Inferior 1 (process 3740) detached]

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted

Sample project:
XF.GTK.zip

DisplayActionSheet and slider control

Hi
Found a few bugs in the DisplayActionSheet and Slider Control.
I wondered if you wanted to add these to your status page. I've generated a pull request on the PlainConcepts fork of Xamarin Forms.

DisplayActionSheet has a problem when there are lots of buttons, e.g. 15 or more. The popup window is too tall for the screen and some buttons and the cancel button are off the edge of the screen.

The slider shows the numerical value (a GTK widget feature). Sliders on other platforms (Droid, iOS) do not show this so for consistency this needs to be removed.

I've done pull requests for both.

Thanks
Roger

.Net Core + GTK3

Do you have any plan to upgrade it and use new technologies ?
Here we have 2 kind of hardwares, ARM without NEON and new hardware ARM with NEON
We are using XF and GTK# for backend for both devices. But we are looking for a way to use .Net Core on New hardware to have better performance.

Webview not working on Linux

Hi, I've created a simple test project with a main page that sets a webview browser as its content. On Windows, it works perfectly fine, but on Linux, I get the following error, and no webview is rendered:
Gtk-CRITICAL **: 16:12:14.372: IA__gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

If I switch out the webview for any other kind of content, it runs fine. I followed the steps you describe in the faq and installed libwebkitgtk-dev, but no luck. I've also looked at your Movies sample project and reproduced the configuration for webview I saw there, to no luck.

Details:

  • Platform: Ubuntu 18.04
  • mono-devel 5.20.1.19
  • libgtk2.0 2.24.32
  • libwebkitgtk-dev 2.4.11

Xamarin GTK on raspberry Pi

Hi
How do you compile the application from Visual Studio for arm platform? I can launch the compiled applications succesfully on normal linux computer but i'm having difficulties running the apps on Raspberry Pi with Raspbian,
I get error:
cannot execute binary file: Exec format error

Linux support in .NET MAUI

Linux runs on a high diversity of devices of different form factors and possibilities.

.NET MAUI will give official support to Android, iOS, macOS and Windows. The purpose of this issue is to collect feedback to specify possible actions at the community level to review Linux support in .NET MAUI.

Linux support in Xamarin.Forms is achieved thanks to a backend using GTK Sharp 2.12.

Possible options for .NET MAUI:

Add your feedback!. What do you think is the best option to add Linux support to .NET MAUI? What would you use it for (Raspberry PI Apps, IoT, Desktop App, etc)?

.net framework target.

I wasn't too sure where to ask this question since this is basically a work in progress, but why does the GTK Platform assembly target .net 4.7? Most Enterprise LOB developers have to adhere to strict rules regarding the .net framework and 3rd party components, opting to stay one major version behind the current release due to stability and potential risk (ie: developing against .net 4.6 currently as opposed to .net 4.7).

I am interested in building a POC of one of our products using the GTK backend but I am severely limited when going into production once it is officially released.

Please advise.

NullReferenceException

Hi
I'm getting this exception at this method
Xamarin.Forms.Platform.GTK.Renderers.NavigationPageRenderer.UpdateBackgroundImage() in D:\a\1\s\Xamarin.Forms.Platform.GTK\Renderers\NavigationPageRenderer.cs:line 157

I suppose I have to add an image to my project but I don't know where

Thanks for your help

Images do not render properly

Images do not layout properly, using the sample movie app (direct from https://github.com/jsuarezruiz/xamarin-forms-gtk-samples) it renders the image in what seems to be roughly the top-left quarter of the element's layout area, like this:

image

I also noticed that the focus highlight around buttons only render in the top-left 1/4 of the button's layout space.

I noticed this on an app I'm playing with on both windows and Raspberry Pi, and checked with the movie sample to confirm it wasn't something I had done in my project.

Xamarin GTK on Rapsberry Pi: rasbian Buster

Hello,
I have troubles installing on a brand new Raspbian buster Xamarin.Forms GTK. (Xamarin.Forms 4.7.0)
Let's say i'm running "GameOfLife". Everything is OK on Windows (Xamarin Forms / GTK)
Now i want to run it on Raspbian:

  1. installing mono from Xamarin repo: ok (6.8.0)
  2. apt install gtk-sharp2 (ok: 2.10 but also labeled 2.12). I note there is also gtk-sharp3
  3. copy bin/ from Windows, and execute it with "mono GameOfLife.GTK.exe"
  4. i have now DllNotFoundException "libglib-2.0-0.dll not found" error, adding it to /etc/mono/config which leads to various errors related to others assemblies not found
  5. Finally, i'm stuck on DllNotFoundException"gtksdharpglue-2", which i'm unable to find in the /etc/mono/config nor on the sdcard of my pi.

What am i doing wrong please ?

Button event handler Released() does not trigger

Description
The event does not fire when releasing button.
Subscribing to clicked does work.

Steps to Reproduce
Create a XP page with a button and subscribe to the respective
event to execute a piece of code.
Create a GTK backend project / Add respective nugets.
Run the GTK project.
nothing happens.

Basic Information
Version with issue: 4.3.0.991221
Last known good version: n/a

Ribbon control

Will there be support for a Ribbon control in the future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.