This project is read-only.

Colored background without flickering

Topics: Installation, Off Topic, Other, Using Cosmos (Developing your own OS, projects, etc)
Apr 10, 2013 at 6:13 PM
How can I make a UI with a colored background that does not flicker?
I am trying to make a UI with a colored background that you use the arrow keys to navigate but whenever I add a background color and add some text to it starts to flicker. And thats really annoying. So is there any way to do this?
Apr 10, 2013 at 6:37 PM
RackAnd wrote:
How can I make a UI with a colored background that does not flicker?
I am trying to make a UI with a colored background that you use the arrow keys to navigate but whenever I add a background color and add some text to it starts to flicker. And thats really annoying. So is there any way to do this?
Don't set the flicker bit in the attribute byte.
Apr 10, 2013 at 6:56 PM
GruntXProductions wrote:
RackAnd wrote:
How can I make a UI with a colored background that does not flicker?
I am trying to make a UI with a colored background that you use the arrow keys to navigate but whenever I add a background color and add some text to it starts to flicker. And thats really annoying. So is there any way to do this?
Don't set the flicker bit in the attribute byte.
What do you mean?

I just put Console.BackgroundColor = ConsoleColor.Blue; but it does not work. It flickers.
Apr 10, 2013 at 8:03 PM
I am talking about your code that prints the character, just make sure you set the last bit to 0, you could always do

c =  c & ~(1 <<7);
Assuming the char C is your text character, the last bit should be set too make it flicked, this could should set it too 0, thus disabling the flicker effect.
Apr 10, 2013 at 8:48 PM
GruntXProductions wrote:
I am talking about your code that prints the character, just make sure you set the last bit to 0, you could always do

c =  c & ~(1 <<7);
Assuming the char C is your text character, the last bit should be set too make it flicked, this could should set it too 0, thus disabling the flicker effect.
I dont have anything like that. I use Console.WriteLine("text");
Apr 10, 2013 at 8:50 PM

So what flickering? When using console, you shouldn't see any.or you mean when cleaning the screen?

Op 10 apr. 2013 21:48 schreef "RackAnd" <[email removed]> het volgende:

From: RackAnd

GruntXProductions wrote:
I am talking about your code that prints the character, just make sure you set the last bit to 0, you could always do

c =  c & ~(1 <<7);
Assuming the char C is your text character, the last bit should be set too make it flicked, this could should set it too 0, thus disabling the flicker effect.
I dont have anything like that. I use Console.WriteLine("text");

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Apr 10, 2013 at 9:20 PM
Edited Apr 10, 2013 at 9:20 PM
Oh you use their code, well its best to write your own implementation of the Console class, that way you can have standard streams, piping ect. That really can't be fixed also if you use their code. I recommend you read this: http://wiki.osdev.org/Text_UI , there is an extra bit attribute that will make the text flash.
Apr 10, 2013 at 9:47 PM

Why then not join us in develop and improve the code we have?

Op 10 apr. 2013 22:20 schreef "GruntXProductions" <[email removed]> het volgende:

From: GruntXProductions

Oh you use there code, well its best to write your own implementation of the Console class, that way you can have standard streams, piping ect. That really can't be fixed also if you use their code. I recommend you read this: http://wiki.osdev.org/Text_UI , there is an extra bit attribute that will make the text flash.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Apr 10, 2013 at 11:23 PM
Edited Apr 10, 2013 at 11:23 PM
Well one I primarily use linux now, my windows computer does not have enough storage to install LocalDB, and its sort of hard to use (its a half broken laptop with a broken keyboard from 2007 xD). Also personally I see OSes created with Cosmos being different and I feel that if you guys implement multitasking and stuff it will 'force' users to stick too one specific kernel design.
Apr 11, 2013 at 1:29 PM
GruntXProduction: if there's one person who should be working on porting cosmos to mono it should be you because you are force to use linux.
Apr 11, 2013 at 8:16 PM
But isn't it anyway to use the following code and fix the flickering background?
Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("TEXT");
Console.WriteLine("TEXT");
Apr 11, 2013 at 8:31 PM
RackAnd wrote:
But isn't it anyway to use the following code and fix the flickering background?
Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("TEXT");
Console.WriteLine("TEXT");
What?????
Apr 12, 2013 at 9:51 PM
Forced to use Linux? I use linux because I have lost faith in Windows, not because I am 'forced' too
Apr 13, 2013 at 12:04 AM
Operating Systems (whatever you use on your desktop) are not religion. You don't need to have faith in them. They either do what you want them to, or they don't.

C# developers (and VB.net of course) are overwhelmingly windows + VS based, by a huge huge margin. In a project with few resources, anything other than VS is wasteful.

I feel happy posting this totally off topic post as about 80% of the messages recently have been kids arguing about unrelated junk.

Cosmos has had the various things you are talking about, on the dev list, for years, and they are no surprise. They are the standard set of core functionality that anyone would want if they were to try and develop a more featured OS on top of cosmos. They are the things that underpin the dotnet runtime environment and make the project actually useful.

If you want to develop your own idea of multitasking, no-one minds, you can replace the cosmos one(s) with your own. But don't moan about cosmos doing it their way, or even ways. That's a core point of the project.

It's maybe less interesting for all the youngsters with school projects to do, but think about a fully managed c# based OS which can be run in a VM, have no licensing costs, and is a self contained web server running the asp.net stack, able to pull the website it serves over the network, compile the pages, then serve away. No extra code that doesn't need to be running, simple to run up a bunch of VMs. Maybe even some frontside load balancers also 100% c#.

Or stuff like Singularity, or maybe some kind of erlang like environment, allowing folks to come up with different models for program execution, inter-app security, reliability, message-passing, and so on.

GUIs and even loading apps/progs are far down the road as a real usable development with an actual purpose. Inventing "new" GUI / windowing environments seems very pointless to me, the existing systems struggle to co-exist, and get developers to write for them, without inventing new ones that no-one wants and don't stand out from anything that already exists. Inventing new partition table / file system stuff, the same story. Sure, code it, whatever, but ... it ain't gonna be useful to almost anyone else in the world.

Arguing about "features" or "ideas" from your pet "OS project" that is just working overtime to re-invent things that will be a core part of any dotnet runtime environment, ie, part of COSMOS likely implemented by plugging mono or whatever, really is imo just a noisy distraction from the actual purpose and work the project needs.

For me, It would be great if that all stayed on your "pet os" forums, cos the 3 schoolmates that care, are there already.
Honestly I am repeatedly surprised the core devs have the patience they do, for all this. Core Devs, thank you for the continued and ongoing work on cosmos, and I think you're getting much closer recently, to the tipping point where cosmos can be easily worked with, and may actually start to gain momentum, after years of your hard work.
Apr 13, 2013 at 12:38 AM
No extra code? The problem is that Cosmos attracts 12 year old VB.Net script kiddies like RackAnd who know nothing about programming and can only copy and paste other peoples code. By implementing the .net core libraries Cosmos becomes less of a native C# compiler (which is all it should be) and more of some bullshit that allows script kiddies too put together operating systems. Personally I have no problem with that though, but the major problem is that people who actually do know what they are doing who use Cosmos look just like the VB.Net script kiddies. Go on OSDev forums right now and mention Cosmos, they will tear you apart! And it also appears you have no taste in operating systems or development environments.
Apr 13, 2013 at 9:44 PM
@RackAnd - Have you tried replacing your CRT monitor with an LCD one?

Also try doing Console.Clear() before and AFTER you set the Console.BackgroundColor property.
Apr 14, 2013 at 7:31 AM
Edited Apr 14, 2013 at 7:32 AM
Okey so I used this code:
Console.Clear();
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Clear();
            Console.WriteLine("This text have a blue background.");
            Console.WriteLine("It is amazing!");
            Console.WriteLine("                          ");
            Console.WriteLine("                          ");
            Console.WriteLine("                          ");
            Console.WriteLine("                          ");
            Console.WriteLine("                          ");
            Console.WriteLine("                          ");
but the screen flickers (or flashes, what you wanna call it) and it's, as I said before, really annoying. And it is only there the text are. The other lines that dont have text dosne't flickers (/flashes)
Apr 14, 2013 at 7:38 AM
If you read the wiki article I sent you then maybe you would be able to solve this problem on your own.
A normal text attribute byte

Bit 76543210
    ||||||||
    |||||^^^-fore colour
    ||||^----fore colour bright bit
    |^^^-----back colour
    ^--------back colour bright bit OR enables blinking Text
By using a bright color, you are setting the bright bit, which is also used by some video cards to produce blinking text. You must stick to either dark colors or use a custom color palate. You would be aware of this if you wrote your own implementation of the Console class
Apr 14, 2013 at 7:56 AM
Edited Apr 14, 2013 at 7:56 AM
I fixed it now, I think. Thanks.