digitalmars.D.learn - undefined identifier doesn't make sense
- Enjoys Math (63/63) May 20 2013 Here's Gui.d:
- Anthony Goins (4/4) May 20 2013 ??
- Enjoys Math (2/6) May 20 2013 That did it!!! Lol crazy. :D Thx
- Enjoys Math (1/1) May 20 2013 Should I put my static methods at module scope then?
- evilrat (3/4) May 20 2013 just don't give symbol(struct/class/function/variable) names same
Here's Gui.d:
module Gui;
private import gtk.MainWindow;
private import ProjectFile;
//   TODO: remove
private import gtk.Label;
class Gui : MainWindow
{
private:
	ProjectFile* proj;
public:
	this() {
		super("Our Audio Synth App");
		
		proj = ProjectFile.loadLastProjectOrNew();
		
		setDefaultSize(600, 400);	//   TODO: default size should be 
loaded from last user-defined
		maximize();		// Maximize window if available
		
		add(new Label("epic lulz"));
		showAll();
	}
	~this() {
		//    TODO
		// If AppSettings dir DNE
			// Create AppSettings dir
		// Save AppSettings file
	}
}
Here's ProjectFile.d:
module ProjectFile;
private import std.stdio;
struct ProjectFile
{
private:
	struct GuiSettings
	{
		// Main window settings
		uint winPosX, winPosY;
		uint winWidth, winHeight;
	}
public:
	GuiSettings gui;
	
	static ProjectFile* loadLastProjectOrNew()
	{
		// if LastProject.txt exits
		   // open LastProject.txt and read the first line
		   // try opening the file with that path & name
				// if success convert the data into a Project file object and 
return it
		// create new ProjectFile using default constructor and return
		
		auto lastProjectDotTxt = new File("LastProject.txt");
		
		return new ProjectFile;
	}
}
The error is:
Building Debug\TheApp.exe...
Gui.d(19): Error: undefined identifier 'loadLastProjectOrNew'
Doesn't make any sense.
 May 20 2013
?? ProjectFile.ProjectFile.loadLastProjectOrNew() ?? maybe.
 May 20 2013
On Tuesday, 21 May 2013 at 03:15:46 UTC, Anthony Goins wrote:?? ProjectFile.ProjectFile.loadLastProjectOrNew() ?? maybe.That did it!!! Lol crazy. :D Thx
 May 20 2013
Should I put my static methods at module scope then?
 May 20 2013
On Tuesday, 21 May 2013 at 04:17:26 UTC, Enjoys Math wrote:Should I put my static methods at module scope then?just don't give symbol(struct/class/function/variable) names same as module
 May 20 2013








 
  
  
  "evilrat" <evilrat666 gmail.com>
 "evilrat" <evilrat666 gmail.com>