Guest User

Untitled

a guest
May 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. //connecting indicator with the scroll-event and altogether with the function indicator_scrolled
  2. g_signal_connect(G_OBJECT(appindicator), "scroll-event", G_CALLBACK(&indicator_scrolled), (gpointer)this);
  3.  
  4. gboolean indicator_scrolled(GtkStatusIcon *status_icon, GdkEventScroll *event, gpointer data){
  5. cout << "The indicator was scrolledn";
  6. MainWindow* m = (MainWindow*)data;
  7. m->action_on_scroll();
  8. }
  9.  
  10. arg0 : The AppIndicator object
  11. arg1 : How many steps the scroll wheel has taken
  12. arg2 : (type Gdk.ScrollDirection) Which direction the wheel went in
  13. user_data : user data set when the signal handler was connected.
  14.  
  15. static void indicator_scrolled(AppIndicator *indicator, guint steps, GdkScrollDirection direction)
  16. {
  17. if (direction == GDK_SCROLL_DOWN)
  18. g_print("DOWNn");
  19. else if (direction == GDK_SCROLL_UP)
  20. g_print("UPn");
  21. else if (direction == GDK_SCROLL_SMOOTH)
  22. g_print("SMOOTHn");
  23. }
Add Comment
Please, Sign In to add comment