The Mono team has released a Mono and Gtk# installer for Windows that provides all of the prerequisites. Furthermore, you can use Gtk# to develop applications in either Mono on any OS, or Microsoft .NET on Windows. In this article, Niel M. Bornstein shows you how to write your first Gtk# program and deploy it in a Windows environment.
Gtk# is different from the WinForms framework that Microsoft .NET developers are accustomed to, although it should not be difficult to get accustomed to it. One major difference you’ll discover quickly is that specifying explicit sizes and coordinates for your widgets is frowned upon in Gtk#. The GNOME project has an extensive set of human interface guidelines that you should keep in mind when designing your Gtk# application.
Oh come on! That’s if my project is meant to be a Gnome application! I’ll design my application however the fuck I want to. Go ahead, “frown upon” me! Sheesh
Agreed concerning following the exact specs of the HIG.
However, there’s a reason that explicit sizes and coordinates of widgets is frowned up. Gtk+ is designed inherintly to handle any language, via Pango. the whole hbox, vbox, etc thing exists so that when your button/widget/whatever ends up in arabic, sandscrit, etc your app doesn’t look like *ss.
Of course, if you only want your application to exist in english, or with only the theme you use, then so be it.
Correct me if I’m wrong, but Gnomo uses GTK toolkit just the same as other Des (As XFCE)
The Gnome people generally gives themselves more credit to the DE than it deserves. For them every GTK application is a Gnome application. You don’t see other DEs people doing the same.
Remember Every Gnome app IS a GTK app.
Every GTK app IS NOT a Gnome app
For them every GTK application is a Gnome application.
Seems to apply to QT/KDE too.
Since when was Skype a KDE app?
http://kde-apps.org/content/show.php?content=14127
Except it is mostly the GNOME people who are involved hand-in-hand with Gtk.
Gtk is designed with gnome heavily in mind, which is why every Gtk app looks good on gnome. Unlike in KDE where a Qt app looks out of place (different toolbars, open dialogs, etc…).
Gtk has done alot of things so that pure gtk programs will fit in very nicly in gnome (like plugabble backends to the file selector, how it sets the gtk/icon themes, and much more).
Infact, when does a gtk program become a gnome program? Does it have to use gnome-vfs? What if its not document opening type of application? Does it need to save settings in gconf? What if it dosn’t need to save many settings?
Are these user hidden features that which determines if its gtk or gnome?
Remember every gtk app can be for all intents and purposes a gnome one.
Let me just add that xfce is a great DE and I like it alot, and I think it’s great what they are doing. But lets be realistic, gtk and gnome work hand in hand.
Btw, on windows, can mono connect to the MS .NET library stack (like winforms?) and can things like Gtk# be plugged into the MS .NET runtime enviorment and compiler?
Nonsense, pure nonsense.
KDE is based on QT, they are not to separate things. And QT apps fit very nicely within KDE. It is very, very easy to make a QT app feel at home within KDE and have the KDE app take advantage of all of KDE’s libraries and extensions. Stop making up shit, for god’s sake.
GET BACK ON TOPIC or ALL comments will be deleted.
This story is not about KDE and Gnome HIGs, it’s about using GTK# under Windows.
Stop making up shit, for god’s sake.
Do you even know what Skype is? Its a cross-platform VOIP service.
http://skype.com/home.html
Its DE indifferent. No KDE libs req!!!
@Eugenia
Sorry for being OT.
Well I got the 1st download but the Novel link
http://forge.novell.com/modules/xfmod/project/?prj2make-sharp.
doesn’t exist anymore for the GTK# part.
To be honest I’m not a fan of the way GTK# handles layout, I much prefer the way it’s done under windows where in general specilaized GUI tools are used to handle layout. I think the reason why the GTK type approach is used by many other kits (eg SWING) is because they don’t have access to really good GUI layout tools. Coupled to the fact than many Linux developers like to manually design GUIs such an approach as taken by GTK fits them well.
I’m not sure where people get the idea that windows layout involves precise coordinates, because it doesn’t, at least not the way we do it. Our GUI layout tools implement automatic scaling and positioning of widgets when windows resize.
Having say this, I think having an easy to use GUI framework such as GTK# for crossplaform work is great.
never mind, found it
There is an absolute positioning layout manager on GTK+.
With it, you can determine x, y, width and height.
It should be very easy to build a GUI designer with it. For example, I’ve built a little example of how to use it with Ruby-GTK:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_layout_example
I haven’t settled yet on the standard widgets that I want to use, but I hope to at least create a mockup of a GUI designer using it.
No, I’m not anxious to using Gtk#, though it’s good to see its development. Who knows in the future…
The standard link on http://www.mono-project.com/downloads/ is (as of 1.0.1) now an updated version of the download previously at the site you mentioned. You can use that instead, and probably should.
To be honest I’m not a fan of the way GTK# handles layout, I much prefer the way it’s done under windows where in general specilaized GUI tools are used to handle layout. I think the reason why the GTK type approach is used by many other kits (eg SWING) is because they don’t have access to really good GUI layout tool
—
the windows way in inferior. this has corrected in .net 2.0 so gnome and kde does it the right way already
now the only one missing is SWT#
seriously though i wish gtk on os x would not require x11
and was more integrated. qt is much better here.
the lack of moderators is being taken serious advantage of.
The Gtk layout widgets are far superior than the lousy Windows Forms ones.
e.g. I could not find a simple layout container in Windows that would stack controls on top of each other, and resize them when the controls grew. Furthermore, I could not find a decent control that was similar to the TextView widget in Gtk (Which allows you to embed images, widgets and other stuff within text)
That being said, Gtk is slow on Windows and thread support is lousy.
Does anyone have any news regarding the use of QT with .NET/Mono?
I think many windows developers would consider it a better choice for their projects but as far as I know there doesn’t seem to be anything usable.
But I think Trolltech still dosen’t give away a GPL version of QT for Windows so that’s probably stopping many multiplatform Projects from adpoting QT as well.
Hope they change their minds on this soon though – Matthias Etrich already pointed out that “something” should be done about a Mono/java Framework for KDE to have multiplatform capabilites – I just hope Trolltech goes all the way and releases QT Windows under GPL as that shouldn’t influence their business model that much at all (like an LGPL version would).
Although I have a good deal of experience with MS .NET, I don’t know Mono or GTK at all (nor much of anything about GNU/Linux). However, I’m excited by the idea of Mono and GTK# and I’m glad that OSNews has frequent posts about Mono. Now that it is in 1.X release I’m ready to play with it on Windows (yeah, I’ll setup a perm Linux unit someday…).
The Hello World program works fine for me, but I have a simple, hopefully quick question, maybe someone would be kind enough to help?
Okay, so in hello world we have:
using Gtk;
and this compiles using:
>mcs -pkg:gtk-sharp SimpleApp.cs
So now I have a this in another test program:
using Gtk;
using GtkSharp;
using Gdk;
using GdkSharp;
using Glib;
using GlibSharp;
using System;
using System.Drawing;
>mcs -pkg:gtk-sharp -r:System.Drawing packingdemo.cs
packingdemo.cs(15) error CS0246: The namespace `Glib’ can not be found (missing assembly reference?)
packingdemo.cs(16) error CS0246: The namespace `GlibSharp’ can not be found (missing assembly reference?)
Compilation failed: 2 error(s), 0 warnings
I’ve tried a number of ways to refer to the Glib package but it just doesn’t take. I don’t even know the right name (I think it is Glib-2.0) but how do I know and how do I add another package reference to the command line…it seems to act screwy when I list more than one -pkg: but that might just be because I have only one package correctly named?
thanks
>To be honest I’m not a fan of the way GTK# handles layout, I >much prefer the way it’s done under windows where in general >specilaized GUI tools are used to handle layout. I think the >reason why the GTK type approach is used by many other kits >(eg SWING) is because they don’t have access to really good >GUI layout tool
—
>the windows way in inferior. this has corrected in .net 2.0 >so gnome and kde does it the right way already
As I said, I don’t see where the idea comes from that windows developers use precise coordinates to do layout. You are misinformed.
As for the phrase ‘inferior’, I guess it explains why Linux GUI tool kits and SWING have been so successful at producing some of the most ubiquitous, visually appealing, ease of use GUI applications ever made, wouldn’t you agree?
>The Gtk layout widgets are far superior than the lousy >Windows Forms ones.
Given this ‘fact’ we are sure then to see a significant increase in the number of GUI applications written using Gtk for windows?
I have to disagree with this ‘fact’, Java GUi apps which use the Gtk approach are some of the worst looking and most badly layout applications I have ever seen. You can usually sopt a SWING application a mile awa simpe by the poor layout.
It’s odd when people tout these facts when the reality is that 99 percent of GUI applications are not written using this ‘superior’ approach?
Come on people, get your heads out of the sand!
Suppose I develop a Mono+Gtk# application under Windows,
does exist a tool that will cover the installation ?
( I mean that it is enough to launch a setup.exe ? )
@Andrea
ClickTeam or NSIS (nsis.sf.net) are both simple to use and effective but I don’t think Mono packages its own.
-DaMouse