Re: MenĂº en Consola

Luis <[email protected]> Wed, 31 Aug 2011 09:11:16 -0400
Newsgroups gmane.comp.gnome.mono.hispano
Organization SUM
Message-ID <op.v02xk2hftyhnfo@jerusalen>
Hola Alexis,

Ya lo tengo. C=F3mo se instala eso?

En Tue, 30 Aug 2011 11:55:29 -0400, Alexis Araya <[email protected]>  =

escribi=F3:

> tal vez te sirva usar Monocurses
>
> http://www.mono-project.com/MonoCurses
>
> hechale un vistaso.
>
> sldos desde Chile
>
>
> 2011/8/30 Luis <[email protected]>
>
>> Hola colegas,
>>
>> Un buen d=EDa para todos.
>>
>> Hace tiempo que estoy compartiendo con Ud. pero en 'silencio'. Ya el
>> silencio se acab=F3  :) .
>>
>> Resulta que estoy metido hasta el cuello con C# en Debian pero no me va
>> muy bien. Estoy tratando de hacer un men=FA en la consola pero cuando  =

>> trato
>> de compilar me da errores con los m=E9todos SetCursorPosition() y
>> CursorVisible(). Me estoy guiando por un ejemplo hecho en windows. Sin
>> embargo, en la consola interactiva si pinchan esos m=E9todos.
>>
>> Les pongo el c=F3digo, y el error, para que vean:
>>
>> using System;
>>
>> namespace Ventana
>> {
>>        public class Ventana
>>        {
>>                public string bordeSuperior =3D "-";
>>                public string bordeInferior =3D "-";
>>                public string bordeIzquierdo =3D "|";
>>                public string bordeDerecho =3D "|";
>>
>>                bool mostrarCursor =3D true;
>>
>>                public Ventana(string bordesuperior, string  =

>> bordeinferior,
>> string
>> bordeizquierdo, string bordederecho)
>>                {
>>                        bordeSuperior =3D bordesuperior;
>>                        bordeInferior =3D bordeinferior;
>>                        bordeIzquierdo =3D bordeizquierdo;
>>                        bordeDerecho =3D bordederecho;
>>                }
>>
>>                public void DibujarVentana(int x1, int y1, int largo, int
>> alto)
>>                {
>>                        //ocultamos el cursor
>>                        System.Console.CursorVisible =3D false;
>>
>>                        //linea superior
>>                        for(int i=3D0; i<largo; i++)
>>                        {
>>                                Console.SetCursorPosition(x1+i,y1);
>>                                Console.Write(bordeSuperior);
>>                        }
>>
>>                        //linea izquierda
>>        //                      for(i=3D2;i<40;i++)
>>        //                      {
>>
>>        //                      }
>>
>>                        //linea derecha
>>        //                      for(i=3D2;i<40;i++)
>>        //                      {
>>
>>        //                      }
>>
>>                        //linea inferior
>>                        for(int i=3D0; i<largo; i++)
>>                        {
>>                                Console.SetCursorPosition(x1+i,y2);
>>                                Console.Write(bordeInferior);
>>                        }
>>
>>                        //mostramos el cursor
>>                        Console.CursorVisible =3D true;
>>
>>
>>                }
>>
>>                public static void Main(string[] args)
>>                {
>>                        Ventana v =3D new Ventana("-", "-", "|", "|");
>>                        v.DibujarVentana(2, 2, 140, 40);
>>
>>
>>
>>
>>                }
>>
>>        }
>> }
>>
>> Tambi=E9n quiero saber c=F3mo obtengo las coordenadas m=E1xima de la pan=
talla.
>> Si alguien puede, aceptar=EDa alg=FAn buen ejemplo de c=F3mo implementar=
 men=FA  =

>> en
>> consola.
>>
>> Error:
>>
>> ventanita.cs(43,40): error CS0117: `System.Console' does not contain a
>> definition for `CursorVisible'
>> /usr/lib/mono/1.0/mscorlib.dll (Location of the symbol related to  =

>> previous
>> error)
>> ventanita.cs(48,41): error CS0117: `System.Console' does not contain a
>> definition for `SetCursorPosition'
>> /usr/lib/mono/1.0/mscorlib.dll (Location of the symbol related to  =

>> previous
>> error)
>> ventanita.cs(67,41): error CS0117: `System.Console' does not contain a
>> definition for `SetCursorPosition'
>> /usr/lib/mono/1.0/mscorlib.dll (Location of the symbol related to  =

>> previous
>> error)
>> ventanita.cs(72,33): error CS0117: `System.Console' does not contain a
>> definition for `CursorVisible'
>> /usr/lib/mono/1.0/mscorlib.dll (Location of the symbol related to  =

>> previous
>> error)
>> Compilation failed: 4 error(s), 0 warnings
>>
>> Ahora, si hago esto:
>>
>> mcs -r:System.Console ventanita.cs
>>
>> error CS0006: cannot find metadata file `System.Console'
>> Compilation failed: 1 error(s), 0 warnings
>>
>> Qu=E9 me est=E1 pasando?, please...
>>
>> --
>> Saludos,
>>
>> Luis Esteban
>> Linuxero por cuenta propia
>> Cuba
>>
>> If Debian GNU/Linux can do it, you can do it too...
>>
>> --
>>
>> Este mensaje le ha llegado mediante el servicio de correo electronico  =

>> que
>> ofrece Infomed para respaldar el cumplimiento de las misiones del  =

>> Sistema
>> Nacional de Salud. La persona que envia este correo asume el compromiso  =

>> de
>> usar el servicio a tales fines y cumplir con las regulaciones  =

>> establecidas
>>
>> Infomed: http://www.sld.cu/
>> _______________________________________________
>> Mono-hispano mailing list
>> [email protected]
>> https://listas.hispalinux.es/mailman/listinfo/mono-hispano
>>
>
>
>



-- =

Saludos,

Luis Esteban
Linuxero por cuenta propia
Cuba

If Debian GNU/Linux can do it, you can do it too...

--

Este mensaje le ha llegado mediante el servicio de correo electronico que o=
frece Infomed para respaldar el cumplimiento de las misiones del Sistema Na=
cional de Salud. La persona que envia este correo asume el compromiso de us=
ar el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/