daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import gdk.Keysyms; //keys enums are defined here
  2.  
  3. private void func(Button sender)
  4. {
  5.     //button pressed
  6. }
  7.  
  8. but.addOnClicked(&func);
  9.  
  10. private bool func2(GdkEventKey* ev, Widget sender)
  11. {
  12.     if(ev.keyval == GdkKeysyms.GDK_Tab)
  13.         return true; //we handle Tab ourselves and prevents default behaviour
  14.     else
  15.         return false; //we didnt handle it so gtk does default behaviour
  16. }
  17.  
  18. win.addOnKeyPress(&func2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top