comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Graphical output on Windows XP
Date: Wed, 30 Mar 2005 18:46:53 -0800
Date: 2005-03-30T18:46:53-08:00	[thread overview]
Message-ID: <BfWdnSlA_anN-dbfRVn-1Q@comcast.com> (raw)
In-Reply-To: e499e546.0503300221.154896f1@posting.google.com

You need to create an event handler to process the keys.

If you look in the source file gwindows-windows.ads there is a procedure 
defined "On_Character_Down_Handler", which is probably what you want.

I don't have an example of using the On_Character_Down_Handler, but I do 
have a similar example for an On_Click_Handler (for a button).

Start out by defining a function to be called when a button is pressed (or 
in your case a character pressed)...

  procedure On_Button_Directory_Click(Window : in out 
GWindows.Base.Base_Window_Type'Class) is
    pragma warnings( off , Window );
    dispName : GString_Unbounded;
    dirPath : GString_Unbounded;
  begin
    Get_Directory( Window, "Open Directory", dispName, dirPath );
  end On_Button_Directory_Click;

...
For my button example, I had to define the button...

  Button_Directory      : Button_Type;

Then create the button and associate the handler with the button

  Create( Button_Directory, Main_Window, "Select Directory", 400, 220, 100, 
20 );
  On_Click_Handler( Button_Directory, On_Button_Directory_Click'Access );

I hope this helps,
Steve
(The Duck)


"Duke Luke" <duke_luke@gmx.de> wrote in message 
news:e499e546.0503300221.154896f1@posting.google.com...
> Hello,
>
> now i have another problem:
>
> i made really nice things with this gnavi-package, but i'm
> not able to get messages from the keyboard (i.e i want to program a
> little tetris game. everything is already working, but i cannot get
> the player's commands from the keyboard while the graphic-window is
> active)
>
> does anyone have suggestions?
> is it possible to do this with the gwindows and gnavi packages or do i 
> have to
> use other packages?
>
> thanks in advance!
>
> greetings,
> Lukas Koenig 





  parent reply	other threads:[~2005-03-31  2:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22  9:41 Graphical output on Windows XP Duke Luke
2005-03-23  0:55 ` Georg Bauhaus
2005-03-25 16:23   ` Duke Luke
2005-03-25 18:22     ` David Botton
2005-03-26 13:57       ` Duke Luke
2005-03-30 10:21       ` Duke Luke
2005-03-31  1:52         ` Randy Brukardt
2005-03-31  2:46         ` Steve [this message]
2005-04-05 13:33         ` Duke Luke
2005-03-25 12:58 ` munnoch
2005-03-29 12:28   ` Duke Luke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox