Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!