FLTK logo

[fltk.general] Re: Fl_Tree

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Fl_Tree "holm.h... Feb 26, 2021  
 

Hi,
Still having problems, I write my handle function:
int ERS_Tree::handle(int e){
  int ret;
  if ( (e==FL_PUSH) && (Fl::event_button() == FL_RIGHT_MOUSE))
      My_Tree_cb(this, NULL);
  ret Fl_Tree::handle(e);
  return ret;
}
In my My_Tree_cb, I call:
   Fl_Tree_Item *item;
   item   = w->callback_item();
item is however not pointing to the item which I clicked.

I have missed something - but what ?

Best regards
Håvard
fredag 26. februar 2021 kl. 13:46:04 UTC+1 skrev lifeatt...@gmail.com:
>Is it possible to make Fl_Tree repond (callbakc) to right-mouse-click ?

Yes. Create a class derived from Fl_Tree, add a custom handle() override, examine the FL_PUSH event, and check for
Fl::event_button() == FL_RIGHT_MOUSE

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/2dd58e02-ba50-4771-baa6-ff487e6b5a4fn%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.