Closed ghost closed 8 years ago
Try using the HAL project instead.
On Fri, Oct 28, 2016 at 10:11 PM, DjAlEx234 notifications@github.com wrote:
I want to make a GUI for my COSMOS project, I have made everything. Now I want to make a GUI for it. I tried the instructions, but I cant figure out how to reference the Hardware project.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CosmosOS/Cosmos/issues/496, or mute the thread https://github.com/notifications/unsubscribe-auth/ARf_UC42XvX29JMOhO_gQDiKBgz01h8hks5q4qs1gaJpZM4Kj_89 .
@MichaelTheShifter it's not the HAL project, it's the Hardware project created during the tutorial. @DjAlEx234 Right-click References in your main Cosmos project (the one without Boot in the name) and click Add Reference, go to Project References and select the Hardware project.
Thanks! I would never look there. I love cosmos and it's community, this helped me a lot.
Okay, so I tried it. It says from this code using Hardware;
Hardware does not exist in this context. Can I have a finished project that works with it?
What namespace did you use in the DisplayDriver class?
CosmosKernel4 (the name of the project)
And the main project is CosmosKernel3?
no the main project is CosmosKernel4
And the project of the DisplayDriver?
Hardware
In the DisplayDriver class, what's the namespace?
shouldn't it be CosmosKernel4? or should it be Display?
If it's CosmosKernel4 you don't need any "using"
then what do you do?
Ignore the "using" part
k i'll try it
I`m confused, can I have a project that is finished?
Finished like what?
the gui part finished. but the default code in run
You did the part of initializing the DisplayDriver?
it showed an error
Whenever you get an error, please paste the output log.
ok
1>------ Build started: Project: Hardware, Configuration: Debug x86 ------ 1> Hardware -> C:\Users\ajcre\Desktop\CosmosKernel4\Hardware\bin\Debug\Hardware.dll 2>------ Build started: Project: CosmosKernel4, Configuration: Debug x86 ------ 2>C:\Users\ajcre\Desktop\CosmosKernel4\CosmosKernel4\Kernel.cs(14,13,14,20): error CS0103: The name 'display' does not exist in the current context 2>C:\Users\ajcre\Desktop\CosmosKernel4\CosmosKernel4\Kernel.cs(15,13,15,20): error CS0103: The name 'display' does not exist in the current context Build has been canceled.
You have something like: public class Kernel : Sys.Kernel {
Right after that write: DisplayDriver display;
?
want the code
In your Kernel.cs file
Paste Kernel.cs contents if you want me to help you better
ok: `using static System.Console; using Sys = Cosmos.System; using System.IO;
namespace CosmosKernel4 { public class Kernel : Sys.Kernel { protected override void BeforeRun() { var fs = new Sys.FileSystem.CosmosVFS(); Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs); Clear(); display = new DisplayDriver(); display.init(); WriteLine("Zach OS booted correctly! Type help for help!"); }
protected override void Run()
{
Main();
}
void Main()
{
CursorVisible = true;
while (true)
{
Write("$: ");
var a = ReadLine();
if ((a == "help") || (a == "about") || (a == "cls") || (a == "restart") || (a == "off")||(a == "dir"))
{
var c_path = Directory.GetCurrentDirectory();
if (a == "help")
{
Help();
}
if (a == "about")
{
About();
}
if (a == "cls")
{
Clear();
}
if (a == "restart")
{
Sys.Power.Reboot();
}
if (a == "off")
{
AfterRun();
}
if (a == "dir")
{
string akhdkuhksihaiuefhiauefhi = "In directory " + c_path;
WriteLine(akhdkuhksihaiuefhiauefhi);
}
}
else
{
string b ="<" + a + ">" + " is not a command";
WriteLine(b);
}
}
}
protected override void AfterRun()
{
base.AfterRun();
Clear();
CursorVisible = false;
WriteLine("It is now safe to turn off your computer");
while (true)// looooooooooooooooooooooooooooooooooooooop
{
ReadKey(true);
}
}
void About()
{
Clear();
WriteLine("About Zach OS");
WriteLine("This is Open Source");
WriteLine("Beta 0.1 Beta");
WriteLine("Build 0199");
}
void Help()
{
Clear();
WriteLine("Here is a list of commands:");
WriteLine("about - Tells you about the OS");
WriteLine("cls - Clears the screen");
WriteLine("dir - Shows the file(s)/folder(s) in the directory");
WriteLine("help - Gives you a list of commands");
WriteLine("off - Turns off the OS");
WriteLine("restart - Restarts the OS");
}
}
}`
As I said: " You have something like: public class Kernel : Sys.Kernel {
Right after that write: DisplayDriver display;
"
after the
public class Kernel : Sys.Kernel {
part? then change it to:
public class Kernel : Sys.Kernel { DisplayDriver display;
Yes
k ill try it
thanks it works! I love the community for this.
I want to make a GUI for my COSMOS project, I have made everything else. Now I want to make a GUI for it. I tried the instructions, but I cant figure out how to reference the Hardware project. Can I have the source code for it? (Or a better tutorial at least)