[Gtk-sharp-list] portability issues

Paulo Pires paulo.pires@vodafone.pt
Fri, 22 Oct 2004 15:00:32 +0100


Hi

After a lot of discussion on #mono @ irc.gnome.org and a bunch of google
searchs, I got this message on mono-list:

http://archive.neotonic.com/archive/mono-list/browse_frm/thread/4854/16605

Of course the problem is the same - GTK isn't thread-safe and we're
trying to deploy a gui-multithreaded app, but what this guy hadn't
discovered was Gdk.Threads. With a Gdk.Threads.Enter() before the
Gtk.Application.Init(), and Gdk.Threads.Enter() plus <GTK-update-works>
plus Gdk.Threads.Leave(), we are able to create a special place for gui
updating outside the GTK mainloop.

The compatibility issues, were discussed and it seems that Gdk is not
fully ported to Windows in gtk-2.2.x, which is the actual bundled
version with mono.

What I am trying to do, is to simply install a previous
mono-combined-installer with GTK-2.4.x and try to run the app. I'll get
the feedback to the list in a few minutes!

Btw, gtk-2.4.x is not bundled with mono anymore because of glade
backwars compatibility, since some widgets created in glade-2.6.x are
non-existant in its previous versions, p.e.: GtkToolItem, GtkToolButton,
etc.

So many thanks to paco for the patience, to tremor for the
mono-combiner-installer and francis for the workaround :)

Cheers
Paulo Pires


Sex, 2004-10-22 =E0s 11:32 +0100, Paulo Pires escreveu:
> Anyone?
>=20
> I've gathered the two scenarios into one final scenario! Check it at
> http://artemis.av.it.pt/~ppires/trafficman.tar.gz
>=20
> It's working great on Linux, but in Windows it's a big *shit* :(
>=20
> Windows: mcs -pkg:gtk-sharp -pkg:glade-sharp -resource:trafficman.glade
> Main.cs wndSplash.cs wndMain.cs Globals.cs
>=20
> It's quite a tiny project, but I'm stuck, and I'm really needing this
> working, so any help is very appreciated.
>=20
>=20
> Thanks in advance
> Paulo Pires
>=20
>=20
> Qui, 2004-10-14 =E0s 19:27 +0100, Paulo Pires escreveu:
> > Hi folks
> >=20
> > I'm new to .NET, GTK and Glade, so perhaps it's my problem instead of
> > GTK# or Glade#.
> >=20
> > I'm trying to develop an app fully-portable between Windows and Linux
> > but some problems came to me while still testing. I've taken two
> > scenarios:
> >=20
> > 1 - A simple Glade# app, built on Glade without any signals, besides
> > delete_event, attached on a bunch of code who shows a Gtk.Window.
> > Well, I've compiled it on Linux and tried to run it in Windows! After
> > installing the combined package of Mono+Gtk-sharp i've runned it and
> > everything went well, except the GtkToolItem and GtkToolButton widgets
> > that weren't recognized. I'm using glade-2.6.2.
> >=20
> > My 1st question is: Are these widgets supported on Windows?
> >=20
> >=20
> > 2 - A-not-so-simple-full-gtk#-app, with two windows: wndSplash and
> > wndMain.
> >=20
> > wndSplash has a Progressbar, which is updated using a Thread that once
> > completed destroys the current Window and creates the wndMain.
> > I had a problem! My wndSplash would die when calling the wndMain, with
> > this error: Xlib: async reply 0x00blablabla.
> > After searching about it, I've realized about GTK mainloop and found th=
e
> > Gdk.Threads.Enter() .Leave() .Init(), etc.
> > This solved my problem, but now, sometimes when I run the resulting exe
> > on Linux, it shows me the wndSplash with all the widgets but the
> > ProgressBar is not updated.
> > All the code is running fine, since I have my own debug on each Thread
> > and it's debuggin right. So I close my app, and try to run it again!
> > SURPRISE! It works very well! The ProgressBar is updated and all the
> > widgets works ...=20
> >=20
> > My 2nd question is: What the hell is going on?
> >=20
> >=20
> > On Windows, I've compiled* it tried to run it and it works, but my
> > Threads don't debug :(. It creates the wndSplash and then wndMain, but
> > all of them without widgets and the program does not respond.
> >=20
> > My 3rd question: Any clue about this?
> >=20
> >=20
> > *compiled: mcs -pkg:gtk-sharp wndSplash.cs wndMain.cs
> >=20
> >=20
> > If you want to checkout the code just ask me thought my personal mail
> > and I'll send it to you.
> > Sorry for my bad english!
> >=20
> > Thanks in advance,
> > Paulo Pires
> >=20
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>=20
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list