/* Mouse callback */ static int event_callback (Gpm_Event *event, void *data) { WTree *tree = data; if (!(event->type & GPM_UP)) return MOU_NORMAL; if (tree->is_panel) event->y--; event->y--; if (!tree->active) change_panel (); if (event->y < 0){ tree_move_backward (tree, tlines (tree) - 1); show_tree (tree); } else if (event->y >= tlines (tree)){ tree_move_forward (tree, tlines (tree) - 1); show_tree (tree); } else { tree_event (tree, event->y); if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){ chdir_sel (tree); } } return MOU_NORMAL; }
/* Mouse callback */ static int event_callback (Gpm_Event *event, void *data) { WTree *tree = data; /* rest of the upper frame, the menu is invisible - call menu */ if (tree->is_panel && (event->type & GPM_DOWN) && event->y == 1 && !menubar_visible) { event->x += tree->widget.x; return the_menubar->widget.mouse (event, the_menubar); } if (!(event->type & GPM_UP)) return MOU_NORMAL; if (tree->is_panel) event->y--; event->y--; if (!tree->active) change_panel (); if (event->y < 0){ tree_move_backward (tree, tlines (tree) - 1); show_tree (tree); } else if (event->y >= tlines (tree)){ tree_move_forward (tree, tlines (tree) - 1); show_tree (tree); } else { tree_event (tree, event->y); if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){ chdir_sel (tree); } } return MOU_NORMAL; }