Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

134
Vistas
GTK# using DrawingArea

I want to write a Snake game using GTK# but for several days I can't figure out the way dealing with DrawingArea. In all the examples that I've found, there's subscribtion to the drawingArea.ExposeEvent event, a method like:

void OnDrawingAreaExposed (object source, ExposeEventArgs args)
{   
    DrawingArea darea = (DrawingArea) source;
    Cairo.Context ctx = Gdk.CairoHelper.Create (darea.GdkWindow);

    // drawing here ...

    ((IDisposable) ctx.Target).Dispose();
    ((IDisposable) ctx).Dispose();
}

But I have neither .ExposeEvent event available on the DrawingArea object, nor the ExposeEventArgs data type. I don't even know what it's about. I would like to deal with rendering, perhaps even in other way, for example to make a bitmap image then assign it to something like PictureBox from WinForms.

Also, I have to draw at set intervals, which means I need other GTK# methods too.

I used darea.GdkWindow to create the Cairo.Context, but it is maked as "deprecated". I've tried just creating a Cairo.Context and then drawing with the darea.Draw(cc) method, but that doesn't work either.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda