User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 11:47 am

PiGraham wrote:I think that is the idea of Mono. You can develop on Windows and deploy to Pi, or even develop on Pi and deploy to Windows.

I assume Mono maps Windows Forms to whatever native API is appropriate to the target. It appears that may be GTK+ on Raspbian.
I suggest you read the Mono documentation on GUI toolkits because it says something different from your assumption.
If you want to be able shift development between platforms, then use MonoDevelop on Pi and Windows. While VS is vastly superior, it uses a different project format so I think that you won't have fun converting between MonoDevelop and VS. In this case, just install Mono with GTK# on Windows and have your way with it. Still, nothing complicated here so I still have the impression that you're deliberately steering into a more complicated path than neccessary.

PiGraham
Posts: 3927
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Modern UI frameworks?

Mon Feb 23, 2015 12:04 pm

ReBoot wrote:
PiGraham wrote:I think that is the idea of Mono. You can develop on Windows and deploy to Pi, or even develop on Pi and deploy to Windows.

I assume Mono maps Windows Forms to whatever native API is appropriate to the target. It appears that may be GTK+ on Raspbian.
I suggest you read the Mono documentation on GUI toolkits because it says something different from your assumption.
If you want to be able shift development between platforms, then use MonoDevelop on Pi and Windows. While VS is vastly superior, it uses a different project format so I think that you won't have fun converting between MonoDevelop and VS. In this case, just install Mono with GTK# on Windows and have your way with it. Still, nothing complicated here so I still have the impression that you're deliberately steering into a more complicated path than neccessary.
I don't know a lot about it, so your comments or corrections are welcome. However, I didn't suggest converting between MonoDevelop and VS. I would not assume that would work. My impression is that a .NET exe can be generated on either platform and run on the other.

http://www.mono-project.com/docs/gui/

Reading some more I see:
System.Windows.Forms in Mono is implemented using System.Drawing. All controls are natively drawn through System.Drawing. System.Windows.Forms implements its own driver interface to communicate with the host OS windowing system. Currently, we have drivers for X11, Win32, and OSX. These drivers translate the native window messages into WndProc compatible messages, to provide as much compatibility with native .Net as possible.

In terms of integrating visually with the desktop, we currently ship with a classic Win32 theme.

http://www.mono-project.com/docs/gui/winforms/
So, reference to GTK+ on monodevelop is something apart from native implementations of winforms. On very brief acquaintance I don't know why monodevelop has any reference to GTK+ controls. I guess it will become clear in time.

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 12:15 pm

This is true. You can totally make a .NET app using VS and run it on Mono. In this case, why would you want to use GTK# or anything else? VS is perfectly capable at creating GUI apps with Windows.Forms and Mono is perfectly capable at running them.
Mind you, you can run it on Mono on Windows too. I did that with a friend's app recently for debugging purposes. Mono's MoMA kinda sucks here, it found the app to be perfectly allright but Mono on the Pi didn't so I've run it on Windows with mono --debug "P:\Ath to the file.exe" to get a debug log from Mono on Windows.

enedil
Posts: 66
Joined: Sat Feb 21, 2015 4:22 pm
Location: Toruń, Poland
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 12:20 pm

PiGraham wrote:I think that is the idea of Mono. You can develop on Windows and deploy to Pi, or even develop on Pi and deploy to Windows.

I assume Mono maps Windows Forms to whatever native API is appropriate to the target. It appears that may be GTK+ on Raspbian.
It surely isn't. It is plain X11.
Mono’s Windows.Forms implementation translates the native system events such as X11 into Win32 WM_ messages and dispatches them using the WndProc mechanism.
This means that GTK+ is not involved.
- What Can a Thoughtful Man Hope for Mankind on Earth, Given the Experience of the Past Million Years?
- Nothing.

Kurt Vonnegut, Cat's Cradle

PiGraham
Posts: 3927
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Modern UI frameworks?

Mon Feb 23, 2015 12:27 pm

Monodevelop designer on Pi mentions GTK controls, which confused me. Next time I look at it I will see if I can work out what that is about.

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 12:36 pm

Because Monodevelop is not VS. Monodevelop uses GTK and it creates .NET-apps that use GTK#. It doesn't mean that GTK# is the only GUI toolkit out there and it doesn't mean that GTK# is the only thing Mono can run. It's one among many and Monodevelop happens to use it.

PiGraham
Posts: 3927
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Modern UI frameworks?

Mon Feb 23, 2015 1:32 pm

ReBoot wrote:Because Monodevelop is not VS. Monodevelop uses GTK and it creates .NET-apps that use GTK#. It doesn't mean that GTK# is the only GUI toolkit out there and it doesn't mean that GTK# is the only thing Mono can run. It's one among many and Monodevelop happens to use it.
Doesn't monodevelop create .NET apps? Where does GTK came into that (besides possibly being used to create monodevelop itself)?

If I create a dialog app in monodevelop on Linux and run it on Windows aren't I creating a .NET / Winforms definition for a dialog that any CLI framework on any supported platform will render, and handle event messages for?

This is my confusion.

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 2:49 pm

PiGraham wrote:
ReBoot wrote:Because Monodevelop is not VS. Monodevelop uses GTK and it creates .NET-apps that use GTK#. It doesn't mean that GTK# is the only GUI toolkit out there and it doesn't mean that GTK# is the only thing Mono can run. It's one among many and Monodevelop happens to use it.
Doesn't monodevelop create .NET apps? Where does GTK came into that (besides possibly being used to create monodevelop itself)?
Do you understand the concept of "library"?
Because you're gonna need that to unerstand. GTK# is a library. It is provided by Mono and it is instlalable on .NET. If a .NET app is compiled using that library, it will run on Mono anyway and on .NET you're gonna have to install the GTK# library separately. Windows.Forms is a library available by default on .NET and Mono.
Or in other words: if you want to develop for .NET using Monodevelop (hell knows why you'd want to do that), you're gonna need to install the GTK# library.

It is just a library! Same as an RSS parser library or PDF creating library or some multimedia library, GTK# is a library!

PiGraham
Posts: 3927
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Modern UI frameworks?

Mon Feb 23, 2015 3:41 pm

Sure I understand the concept of a library.
Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of cross platform applications.

http://www.mono-project.com/

If you define a UI for mono you doing so using the .NET framework, right? Windows forms is part of .NET. If you are developing a .NET GUI application, on any platform, to run on any platform, you could do so using WinForms, right? Why would you not do that? Why would you write a .NET application using another UI core library that is not .NET?
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.
http://www.mono-project.com/docs/gui/gtksharp/
Is GTK a richer framework than WinForms?
Last edited by PiGraham on Mon Feb 23, 2015 3:46 pm, edited 1 time in total.

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Mon Feb 23, 2015 3:43 pm

PiGraham wrote:Why would you write a .NET application using another UI core library that is not .NET?
Because the folks behind Monodevelop decided that. Why don't you ask them why they haven't adopted Windows.Forms?

PiGraham
Posts: 3927
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Modern UI frameworks?

Mon Feb 23, 2015 4:16 pm

ReBoot wrote:
PiGraham wrote:Why would you write a .NET application using another UI core library that is not .NET?
Because the folks behind Monodevelop decided that. Why don't you ask them why they haven't adopted Windows.Forms?
Fair point.

It seems Sharp Develop is the route for a non-MS IDE with WinForms / mono.
http://en.wikipedia.org/wiki/SharpDevelop

You can write WinForms/mono code in monodevelop, but you don't get a visual designer.

Although there is no WinForms project template, you can write WinForms apps in MD on any of the platforms MD runs on.

Just create a new empty C# project and add a reference to System.Windows.Forms, then write your code, and build & run. Although there's no Winforms designer in MD, you'll have code completion for the Winforms types.

http://stackoverflow.com/questions/1402 ... onodevelop
SharpDevelop is windows only.

darryletter
Posts: 76
Joined: Thu Jan 01, 2015 8:52 pm
Location: KC,MO

Re: Modern UI frameworks?

Tue Feb 24, 2015 4:32 am

PiGraham wrote:
ReBoot wrote:
PiGraham wrote:Why would you write a .NET application using another UI core library that is not .NET?
Because the folks behind Monodevelop decided that. Why don't you ask them why they haven't adopted Windows.Forms?
Fair point.

It seems Sharp Develop is the route for a non-MS IDE with WinForms / mono.
http://en.wikipedia.org/wiki/SharpDevelop

You can write WinForms/mono code in monodevelop, but you don't get a visual designer.

Although there is no WinForms project template, you can write WinForms apps in MD on any of the platforms MD runs on.

Just create a new empty C# project and add a reference to System.Windows.Forms, then write your code, and build & run. Although there's no Winforms designer in MD, you'll have code completion for the Winforms types.

http://stackoverflow.com/questions/1402 ... onodevelop
SharpDevelop is windows only.
oh god thank you to for this discussion it has been very helpful.

So let me add one thing there is a graphical framework it is called Xamarin Studio but from what i have seen its no good for cross-platform dev.

Can i sum up the discussion so far VS can be used to dev for mono and .net apps that will be run on windows or rpi.
I only need mono installed to run them with mono.
So any .net/window app i write will or should run in mono on windows or the rpi
Life After 60 sucks

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Tue Feb 24, 2015 8:20 am

Not any. Mono AFAIK doesn't support WPF so you better make a Windows.Forms app. That is the case now, Microsoft announced to bring .NET to Linux themselves, but I am not sure if they mean .NET core only or everything and it's unknown when it will happen. So for now, you're better of targeting Mono.

darryletter
Posts: 76
Joined: Thu Jan 01, 2015 8:52 pm
Location: KC,MO

Re: Modern UI frameworks?

Tue Feb 24, 2015 6:17 pm

ReBoot wrote:Not any. Mono AFAIK doesn't support WPF so you better make a Windows.Forms app. That is the case now, Microsoft announced to bring .NET to Linux themselves, but I am not sure if they mean .NET core only or everything and it's unknown when it will happen. So for now, you're better of targeting Mono.
so then maybe python with the gtk+ module and PYgobject to dev the gui or what would you all suggest.
Life After 60 sucks

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Tue Feb 24, 2015 7:29 pm

darryletter wrote:
ReBoot wrote:Not any. Mono AFAIK doesn't support WPF so you better make a Windows.Forms app. That is the case now, Microsoft announced to bring .NET to Linux themselves, but I am not sure if they mean .NET core only or everything and it's unknown when it will happen. So for now, you're better of targeting Mono.
so then maybe python with the gtk+ module and PYgobject to dev the gui or what would you all suggest.
Since you've quoted me, I'm gonna answer. Frankly, I don't see any advantage of Python with GTK+ over .NET and Win.Forms. Actually, I prefer C# over Python, be it for the clearer structure (this of Python absolutely lacks) or for the great tooling. Visual Studio's IntelliSense is second to none.

darryletter
Posts: 76
Joined: Thu Jan 01, 2015 8:52 pm
Location: KC,MO

Re: Modern UI frameworks?

Tue Feb 24, 2015 11:11 pm

I can use C# though i will have to learn it but i have been programming long enough that it will not be that hard for me. But is there any other packages you use for the rpi. How do you build for mono. I have only ever used VS for the PC world not the embedded world.
Life After 60 sucks

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Modern UI frameworks?

Tue Feb 24, 2015 11:46 pm

Just build with VS. Mono will run the resulting EXE.

Return to “Graphics programming”