Salut la Zone,
Je bosse sous Mono 1.0.5 avec Gtk#.
J’essaie d’écrire un programme sous Linux qui affiche une image après avoir fait un screenshot. J’ai déclaré ma Gtk.Image dans mon fichier gui.glade, elle affiche bien l’image au démarrage, mais lorsque je veux rafraîchir ce display, ça ne rafraîchit jamais.
Si je relance l’appli, elle m’affiche la nouvelle image.
J’ai fait 6 tests :
[code]// project created on 27/01/2005 at 17:51
using System;
using Gtk;
using Glade;
using System.Collections;
using System.IO;
using System.Diagnostics;
using Gdk;
public class GladeApp
{
[Widget] Button goButton;
[Widget] Gtk.Image image1;
[Widget] Gtk.Window window1;
public static void Main (string[] args)
{
new GladeApp (args);
}
public GladeApp (string[] args) {
Application.Init();
Glade.XML gxml = new Glade.XML (null, “gui.glade”, “window1”, null);
gxml.Autoconnect (this);
Application.Run();
}
/* Connect the Signals defined in Glade */
public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
{
Application.Quit ();
args.RetVal = true;
}
public void on_goButton_clicked(object o, EventArgs args)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = “import”;
proc.StartInfo.Arguments="/tmp/hello.png";
proc.Start();
while(!proc.HasExited)
System.Console.WriteLine(“J’attend”);
proc.Close();
// Test 1
// Pixbuf pix = new Pixbuf("/tmp/hello.png");
//image1.FromPixbuf = pix;
// Test 2
//image1 = new Gtk.Image(pix);
// Test 3
//image1.Pixbuf = new Gdk.Pixbuf (null, “/tmp/hello.png”);
// Test 4
//image1 = new Image("/tmp/hello.png");
// Test 5
//image1.FromFile = “/tmp/hello.png”;
// Test 6
//image1.Stock = “/tmp/hello.png”;
image1.Show();
window1.ShowAll();
goButton.Label = “Ciao”;
}
}[/code]