Re: Saludo y pregunta ultra tonta

Jonatan Anauati <[email protected]>
Newsgroups gmane.comp.gnome.mono.hispano
Message-ID <1235309422.12653.10.camel@dino-thunder_ng>
Buenos dias, te comento que lo que te falta hacer es enlazar tu
manejador de evento (void OnTextview1KeyPressEvent) con el evento
KeyPressEvent:

window.KeyPressEvent += new KeyPressEventHandler
(OnTextview1KeyPressEvent);

Con esto te debería funcionar. Te paso un ejemplo:

using Gtk;
using System;

namespace TestGtkSharp
{
    class MainClass
    {
        public static void Main (string [] args)
        {
            Application.Init();
            Gtk.Window win = new Window ("Ejemplo");
            win.KeyPressEvent += new KeyPressEventHandler
(shortcutCallBack);
            win.Show ();
            Application.Run ();
        }

        private static void shortcutCallBack (object sender,
KeyPressEventArgs args)
        {
            System.Console.WriteLine ("press");
        }
    }
}

Un saludo.
El dom, 22-02-2009 a las 07:21 -0200, Juan BC escribió:

> Muy buenas, ante todo un saludo a la gente de mono hispano, me llamo 
> Juan soy desarrollador (casi ingeniero) tengo conocimientos en Java, 
> python, bash, erlang y ahora me sente con C#, era una deuda que me tenia 
> y era hora de empezar con .net/mono
> 
> La pregunta esta debe haber salido MIL veces pero juro ante satanás que 
> googlee como un condenado y no encontré la respuesta:
> 
> Como cuerno con GTK# logro atrapar un evento de teclado KeyPress solo me 
> atrapa los shift y teclas especiales pero nada de alfanumérico.
> 
> Les adhiero mi función (que no anda) y les paso un link donde esta el 
> repo del pet-program que estoy haciendo asi espero me ayuden a 
> solucionarlo. Gracias
> 
> 
> protected virtual void OnTextview1KeyPressEvent (object o, 
> Gtk.KeyPressEventArgs args)
>          {
>                  Console.WriteLine("DLDLDL");
> 
>          }
> 
> 
> SVN [proyecto para monodevelop]
> http://code.google.com/p/jbc-mini-projects/source/browse/trunk/mono/monook/
> _______________________________________________
> Mono-hispano mailing list
> [email protected]
> https://listas.hispalinux.es/mailman/listinfo/mono-hispano

-- 
por favor evita el enviarme archivos adjuntos de MS Word. 
Ver:http://www.gnu.org/philosophy/no-word-attachments.es.html
printk("fent linux\n");

_______________________________________________
Mono-hispano mailing list
[email protected]
https://listas.hispalinux.es/mailman/listinfo/mono-hispano
smime.p7s (application/x-pkcs7-signature, 3.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.