Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //connecting indicator with the scroll-event and altogether with the function indicator_scrolled
- g_signal_connect(G_OBJECT(appindicator), "scroll-event", G_CALLBACK(&indicator_scrolled), (gpointer)this);
- gboolean indicator_scrolled(GtkStatusIcon *status_icon, GdkEventScroll *event, gpointer data){
- cout << "The indicator was scrolledn";
- MainWindow* m = (MainWindow*)data;
- m->action_on_scroll();
- }
- arg0 : The AppIndicator object
- arg1 : How many steps the scroll wheel has taken
- arg2 : (type Gdk.ScrollDirection) Which direction the wheel went in
- user_data : user data set when the signal handler was connected.
- static void indicator_scrolled(AppIndicator *indicator, guint steps, GdkScrollDirection direction)
- {
- if (direction == GDK_SCROLL_DOWN)
- g_print("DOWNn");
- else if (direction == GDK_SCROLL_UP)
- g_print("UPn");
- else if (direction == GDK_SCROLL_SMOOTH)
- g_print("SMOOTHn");
- }
Add Comment
Please, Sign In to add comment