Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Using GtkAda handlers

Using GtkAda handlers

Using GtkAda handlers

I am trying to draw a grid on Gtk_Drawing Area. I want that drawing to
appear when then program starts before anything is done.
I can draw that grid and see it but whenever the program redraws the window
it disappears as a whole or in some cases partly. As various sources I found
out that I have to act on the draw signal. As I build my GUI with Glade 3 I
thought I could connect the drawing signal with:

CODE -->

  (Builder      => Builder,
   Handler_Name => "On_Area_Draw", -- from XML file <signal handler=..>
   Handler      => Sudoku_Callbacks.On_Area_Draw'Access); 

Where I coupled "On_Area_Draw" in Glade with the draw signal in the
Gtk_Drawing_Area. Although This was carried out case Sensitive the program
aborted. The most likely reason therefor is that the handler procedure was:

CODE -->

procedure On_Area_Draw (Object : access Gtkada_Builder_Record'Class); 
where it should have been

CODE -->

function On_Area_Draw (Object : access Gtkada_Builder_Record'Class; Context 
: Cairo.Cairo_Context) return boolean; 
Using the last results in aborting the compilation.

The question now is how should I connect the draw signal to which
function/procedure to get a correct working program?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close