[Gtk-sharp-list] NPlot + Gtk# + Windows

Ivan ivan.teoh at gmail.com
Wed Dec 28 04:46:27 EST 2005

Hi Gena,

Thanks for your quick reply.
I manage to build the first sample.
These are what I done:
- get the source code for the lastest NPlot (0.9.9)
- recompile the whole source code with latest .net (2.0) and
gtk-sharp.dll (2.4) to generate NPlot.dll
- get the soure code
(as what Gena mentioned)
- Graphics.cs: change the namespace from Gtk.DotNet to Gdk
- get the source code Miguel's files Gtk.PlotSurface2D.cs (from
http://primates.ximian.com/~miguel/tmp/NPlot-Gtk- as
what Gena mentioned
- Gtk.PlotSurface2D.cs: update the method below:

//Axis xAxis1Cache;
//Axis yAxis1Cache;
//Axis xAxis2Cache;
//Axis yAxis2Cache;

public void Add (IDrawable p)
			ps.Add (p, 0);

public void Add (IDrawable p, NPlot.PlotSurface2D.XAxisPosition xp,
NPlot.PlotSurface2D.YAxisPosition yp)
			ps.Add (p, xp, yp, 0);

		public void Remove (IDrawable p)
			ps.Remove( p );

public void Remove( IDrawable p, bool updateAxes )
			ps.Remove(p, updateAxes);

public void Add (IDrawable p, int zOrder)
			ps.Add (p, zOrder);

public void Add (IDrawable p, NPlot.PlotSurface2D.XAxisPosition xp,
NPlot.PlotSurface2D.YAxisPosition yp, int zOrder)
			ps.Add (p, xp, yp, zOrder);

public int LegendZOrder
				return ps.LegendZOrder;
				ps.LegendZOrder = value;

- recompile both Gtk.PlotSurface2D.cs and Graphics.cs with NPlot.dll
with latest .net (2.0) and gtk-sharp.dll (2.4) to generate
csc -target:library -out:NPlot.Gtk.dll -r:System.Web.dll
-r:System.Design.dll -r:System.Drawing.dll -r:System.Data.dll
-r:gtk-sharp.dll -r:NPlot.dll -lib:"C:\Program
Files\Mono-1.1.12\lib\mono\gtk-sharp-2.0" Gtk.PlotSurface2D.cs

It works fine on test.cs that provide on
csc -target:exe -out:test.exe -r:NPlot.dll -r:NPlot.Gtk.dll
-r:gtk-sharp.dll -r:System.Drawing.dll -lib:"C:\Program
Files\Mono-1.1.12\lib\mono\gtk-sharp-2.0" test.cs


On 12/22/05, Gennadiy Donchyts <don at env.com.ua> wrote:
> Hi,
> > (1)When I try to add NPlot.Gtk.PlotSurface2D into Gtk.Widget (such as
> > HBox), I got this compile error:
> > error CS1502: The best overloaded method match for
> > `Gtk.Container.Add(Gtk.Widget)' has some invalid arguments
> > error CS1503: Argument 1: Cannot convert from
> > `NPlot.Gtk.PlotSurface2D' to `Gtk.Widget'
>  strange, in my case it is Widget-convertable without any problems since it
> is DrawingArea.
So you add

> > (2)Do we need gtk-dotnet.dll in order to use NPlot? If yes, where can I
> get it?
>  no
> > (3)Do we need nplot.gtk.dll in order to use NPlot on gtk#? If yes,
> > where can I get it?
>  yes and no, you can delete sysdraw.cs and use gtk-dotnet.dll or you can
> simply replace it
>  with
> http://svn.myrealbox.com/source/trunk/gtk-sharp/gtkdotnet/Graphics.cs.
> Also it is necessary
>  to correct namespace name there in both cases.
> > (4)I saw there are many version NPlot on internet (such as
> >
> http://primates.ximian.com/~miguel/tmp/NPlot-Gtk-
> and
> > http://gnomefiles.org/app.php?soft_id=639) . Which one is
> suitable for
> > GTK# on Windows platform?
>  You can use 9.8.5 (afaik it is the last port) or in order to have the last
> version it is better to grab the last from
>  NPlot sourceforge page and try to extend it with Miguel's files
> Gtk.PlotSurface2D.cs and Graphics.cs
>  from gtk-dotnet. Should work fine.
>  --Gena

More information about the Gtk-sharp-list mailing list