[Gtk-sharp-list] portability issues
Francis Brosnan Blázquez
Fri, 22 Oct 2004 15:02:12 +0200
El jue, 14-10-2004 a las 20:27, Paulo Pires escribió:
> Hi folks
> I'm new to .NET, GTK and Glade, so perhaps it's my problem instead of
> GTK# or Glade#.
> 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
> 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.
> My 1st question is: Are these widgets supported on Windows?
I had the same problem with other widgets (specially Gtk.Combo and
menuitems with images). You have to know that gtk# project is wrapping
libraries such as libglade and gtk, but the version they are working
with aren't the lastest. This means that if you have the lastest version
of libglade installed in your linux box, maybe you will have problem
because the windows installer comes with a no-so-lastest-libglade.
You should try to detect which widgets are not working properly. Then
remove them from the .glade file and make your program to load those
widgets by creating them with gtk calls.
> 2 - A-not-so-simple-full-gtk#-app, with two windows: wndSplash and
> 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 the
> 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 ...
> My 2nd question is: What the hell is going on?
why are you using threads?. I thing you should use threads only if you
don't have another way (or you cannot choose). Maybe you can use
GLib.Idle.Add and GLib.Timeout.Add methods to avoy using Threads.
> 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.
> My 3rd question: Any clue about this?
> *compiled: mcs -pkg:gtk-sharp wndSplash.cs wndMain.cs
> 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!
> Thanks in advance,
> Paulo Pires
> Gtk-sharp-list maillist - Gtkemail@example.com