Well I kind of forgot to paste the code as I promised :P

so here is it

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++  Include VXL files  +++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
#include <vgui/vgui.h>
#include <vgui/vgui_projection_inspector.h>

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++  Include external files  ++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
#include "Tgui_picker_tableau.h"

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++  Implementation  ++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
vgui_picker_tableau::object_type vgui_picker_tableau::obj_type = none_enum;

//========================================================================
//: Constructor, takes a child tableau.
vgui_picker_tableau::vgui_picker_tableau(vgui_tableau_sptr const& t)
  :child_tab(this, t)
{
  use_event_ = false;
  pointx = 0; pointy = 0;
  point_ret = true;
}

//========================================================================
//: Destructor.
vgui_picker_tableau::~vgui_picker_tableau()
{
}

//========================================================================
//: Gets a user selected point.
//  This function grabs the event loop and will not return until a
//  mouse down event occurs.
//  Returns true if this is done with the left mouse button, otherwise false.
//  The coordinates of the point are returned in the parameters.
bool vgui_picker_tableau::pick_point(float* x, float* y)
{
  obj_type = point_enum;
  picking_completed = false;
  //point_ret = true;
  vgui::flush();  // handle any pending events before we grab the event loop.

  // Grab event loop until picking is completed:
  while (picking_completed == false)
        next();
   
  *x = pointx;
  *y = pointy; 
  obj_type = none_enum;

  // deselect all
  //deselect_all_highlighted_objects();
  return point_ret;
}

//========================================================================
//: Handles all events for this tableau.
//  We grab events in this way rather than using a vgui_event_server because
//  if we look at events outside the handle function then the gl state
//  associated with those events will have changed.  This means for a
//  draw_overlay event we would end up drawing into the wrong buffer.
//  For a mouse event we would not be able to get the position in the image
//  using the projection_inspector (if e.g. the image was zoomed) since all
//  the gl matrices would have been reset.
bool vgui_picker_tableau::handle(const vgui_event& event)
{
  use_event_ = true;
 
  //---- Object type is point -----
  if (obj_type == point_enum)
  {
    if (event.type == vgui_BUTTON_DOWN && event.button == vgui_LEFT)
    {
      vgui_projection_inspector p_insp;
      p_insp.window_to_image_coordinates(event.wx, event.wy, pointx, pointy);
      point_ret = true;
      picking_completed = true;
      return true;
    }
   
    if (event.type == vgui_KEY_PRESS || event.type == vgui_FOCUSLOST)
    {
        picking_completed = true;
        point_ret = false;
        //obj_type = none_enum;
        return true;
    }
  }

  // Pass events on down to the child tableaux:
  return child_tab->handle(event);
}


//========================================================================
//: Get next event in event loop
bool vgui_picker_tableau::next()
{
  use_event_ = false;

  while (!use_event_)
    vgui::run_one_event();
}
--
Grtz
Rowin Heymans