Lord Illidan
July 25th, 2007, 07:03 PM
Hi guys/gals.
I am trying to learn more about mono and gtk#, and I've been looking at some internet resources to speed me on my way, yet I've come across a funny stumbling block.
On this site, http://www.mono-project.com/GtkSharp:_Frames, I found the following example.
// frame.cs - Gtk# Tutorial example
//
// Author: Johannes Roith >johannes@jroith.de<
//
// (c) 2002 Johannes Roith
namespace GtkSharpTutorial {
using Gtk;
using System;
using System.Drawing;
public class frame
{
static void delete_event (object obj,
DeleteEventArgs args)
{
Application.Quit();
}
public static void Main( string[] args)
{
/* Initialise GTK */
Application.Init();
/* Create a new window */
Window window = new (http://www.google.com/search?q=new+msdn.microsoft.com) Window ("Frame
Example");
/* Here we connect the "destroy" event to a
signal handler */
window.DeleteEvent += delete_event;
window.SetSizeRequest(300, 300);
/* Sets the border width of the window. */
window.BorderWidth= 10;
/* Create a Frame */
Frame frame = new (http://www.google.com/search?q=new+msdn.microsoft.com) Frame("MyFrame");
window.Add(frame);
/* Set the frame's label */
frame.Label = "GTK Frame Widget";
/* Align the label at the right of the
frame */
frame.SetLabelAlign((float)1.0,(float)0.0);
/* Set the style of the frame */
frame.ShadowType = (ShadowType) 4;
frame.Show();
/* Display the window & all widgets*/
window.ShowAll();
/* Enter the event loop */
Application.Run();
}
}
}
Apart from the confusion in using frame as an identifier TWICE, it doesn't seem bad. However, I get the following error when I run the program.
`Gtk.Frame' does not contain a definition for `SetLabelAlign'(CS0117)
Any ideas? In mono-doc, SetLabelAlign is mentioned...why is it not here?
I am trying to learn more about mono and gtk#, and I've been looking at some internet resources to speed me on my way, yet I've come across a funny stumbling block.
On this site, http://www.mono-project.com/GtkSharp:_Frames, I found the following example.
// frame.cs - Gtk# Tutorial example
//
// Author: Johannes Roith >johannes@jroith.de<
//
// (c) 2002 Johannes Roith
namespace GtkSharpTutorial {
using Gtk;
using System;
using System.Drawing;
public class frame
{
static void delete_event (object obj,
DeleteEventArgs args)
{
Application.Quit();
}
public static void Main( string[] args)
{
/* Initialise GTK */
Application.Init();
/* Create a new window */
Window window = new (http://www.google.com/search?q=new+msdn.microsoft.com) Window ("Frame
Example");
/* Here we connect the "destroy" event to a
signal handler */
window.DeleteEvent += delete_event;
window.SetSizeRequest(300, 300);
/* Sets the border width of the window. */
window.BorderWidth= 10;
/* Create a Frame */
Frame frame = new (http://www.google.com/search?q=new+msdn.microsoft.com) Frame("MyFrame");
window.Add(frame);
/* Set the frame's label */
frame.Label = "GTK Frame Widget";
/* Align the label at the right of the
frame */
frame.SetLabelAlign((float)1.0,(float)0.0);
/* Set the style of the frame */
frame.ShadowType = (ShadowType) 4;
frame.Show();
/* Display the window & all widgets*/
window.ShowAll();
/* Enter the event loop */
Application.Run();
}
}
}
Apart from the confusion in using frame as an identifier TWICE, it doesn't seem bad. However, I get the following error when I run the program.
`Gtk.Frame' does not contain a definition for `SetLabelAlign'(CS0117)
Any ideas? In mono-doc, SetLabelAlign is mentioned...why is it not here?