public void AddButton(IMouseTarget b)
 {
     if(sub_buttons == null){
         sub_buttons = new List<IMouseTarget>();
     }
     sub_buttons.Add(b);
 }
 /*public static Action<int,int> GetDrag(Point p){
     var n = buttonstack.Last;
     if(n != null && n.Value != null){
         foreach(IMouseTarget b in n.Value){
             var d = b.OnDrag(p);
             if(d != null){
                 //drag_rect_offset = new Point(
                 return d;
             }
         }
     }
     return null;
 }
 private static Button CheckDraggableButton(Button b,Point p){
     if(b.rect.Contains(p)){
         if(b.sub_buttons != null){
             foreach(Button sub in b.sub_buttons){
                 Button result = CheckDraggableButton(sub,p);
                 if(result != null){
                     return result;
                 }
             }
         }
         if(b.draggable){
             return b;
         }
     }
     return null;
 }*/
 public static void AddButton(IMouseTarget b)
 {
     if(buttonstack.Last.Value == null){
         buttonstack.Last.Value = new List<IMouseTarget>();
     }
     buttonstack.Last.Value.Add(b);
 }
 public static void RemoveButton(IMouseTarget b)
 {
     if(buttonstack.Last.Value != null){
         buttonstack.Last.Value.Remove(b);
     }
 }
 public void RemoveButton(IMouseTarget b)
 {
     if(sub_buttons != null){
         sub_buttons.Remove(b);
     }
 }