[Gtk-sharp-list] Gtk# Image question

mbeattie mtbeedee at gmail.com
Sat Sep 17 22:45:01 EDT 2011


I am new to C#, Mono, and GTK so go easy on me. 

I was following a tutorial for some HelloWorld thing and was wondering how
to make it insert an image in place of the text label.  So I was trying to
use Gtk.Image("filename.jpg") which both compiles and runs but displays no
image.  I am using monodevelop... where is it looking for this image?  Do I
need to import it into the "solution" somewhere? 

Code is like this: 

 using System; 
 using Gtk; 
  
 public class GtkHelloWorld { 
        public static void Main() {	
                Application.Init(); 
                Window myWin = new Window("Window"); 
                myWin.Resize(200,200); 
                Image img = new Image("filename.jpg"); 
                myWin.Add(img); 
                myWin.ShowAll(); 
                Application.Run();   
        } 
}

--
View this message in context: http://mono.1490590.n4.nabble.com/Gtk-Image-question-tp3821272p3821272.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.


More information about the Gtk-sharp-list mailing list