Re: Gtk::Main::signal_key_snooper()



#include <gtkmm/main.h>
#include <gtkmm/window.h>

class MainWindow : public Gtk::Window
{
public:
   MainWindow()    {  show_all();   }
   int KeySnooper(Gtk::Widget *w,GdkEventKey *e)
   {
      printf("Key %x (%s) type %s\n",e->keyval,e->string,
e->type == GTK_KEY_RELEASE ? "KEY_PRESS" : "KEY_RELEASE);
       return true
    }
};

int main( int argc,char **argv)
{
   Gtk::Main kit(argc,argv);
   MainWindow m;
kit.signal_key_snooper().connect(sigc::mem_fun(m,&MainWindow::KeySnooper));
   Gtk::Main::run(m);
   return 0;
}

Шевчук Андрій Ярославович wrote:
Hi!

I need example, how to use Gtk::Main::signal_key_snooper().connect...

thanks.
---
Sorry for my bad English...
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]