This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: feature suggestion


On 20 Dec 2001, Tom Tromey wrote:

> I think that B3 on the breakpoint window should automatically select
> the breakpoint under the mouse.  I keep trying to use the right button
> to bring up the menu, but first I have to select the item I'm
> interested in.  This has happened 4-5 times already ... changing this
> would be convenient.

Your wish is my command...

Try this and let me know if you find any problems with it.

Keith

Index: gdbtk/library/bpwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/bpwin.itb,v
retrieving revision 1.9
diff -u -p -r1.9 bpwin.itb
--- gdbtk/library/bpwin.itb	2001/11/05 19:15:17	1.9
+++ gdbtk/library/bpwin.itb	2001/12/21 06:16:52
@@ -265,6 +265,7 @@ body BpWin::bp_add {bp_event {tracepoint
     foreach thing $zz {
       bind $twin.${thing}${i} <1> "$this bp_select $i"
       bind $twin.${thing}${i} <Double-1> "$this goto_bp $i"
+      bind $twin.${thing}${i} <3> [code $this _select_and_popup $i %X %Y]
     }
   }

@@ -368,7 +369,6 @@ body BpWin::bp_select { r } {

     foreach thing $zz {
       $twin.${thing}${i}  configure -fg [pref get gdb/font/select_fg] -bg $bg1
-      bind $twin.${thing}${i} <3> break
     }
   }

@@ -386,17 +386,12 @@ body BpWin::bp_select { r } {
     $itk_interior.m.bp entryconfigure "Disabled" -state disabled
     $itk_interior.m.bp entryconfigure "Remove" -state disabled

-    foreach thing $zz {
-      bind $twin.${thing}${r} <3> break
-    }
-
     return
   }

   foreach thing $zz {
     $twin.${thing}${r} configure -fg [pref get gdb/font/select_fg] \
       -bg [pref get gdb/font/select_bg]
-    bind $twin.${thing}${r}  <3> "tk_popup $Menu %X %Y"
   }

   if {$tracepoints == 0} {
@@ -424,6 +419,21 @@ body BpWin::bp_select { r } {
   $Menu entryconfigure "Remove" -command "$this bp_remove $r" -state normal

   set selected $r
+}
+
+# ------------------------------------------------------------------
+#  NAME:         private method BpWin::_select_and_popup
+#  DESCRIPTION:  Select the given breakpoint and popup the options
+#                menu at the given location.
+#
+#  ARGUMENTS:    None
+#  RETURNS:      Nothing
+# ------------------------------------------------------------------
+body BpWin::_select_and_popup {bp X Y} {
+  if {$selected != $bp} {
+    bp_select $bp
+  }
+  tk_popup $Menu $X $Y
 }

 # ------------------------------------------------------------------
Index: gdbtk/library/bpwin.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/bpwin.ith,v
retrieving revision 1.2
diff -u -p -r1.2 bpwin.ith
--- gdbtk/library/bpwin.ith	2001/04/19 22:51:02	1.2
+++ gdbtk/library/bpwin.ith	2001/12/21 06:16:52
@@ -53,6 +53,7 @@ class BpWin {
     method bp_add {bp_event {tracepoint 0}}
     method bp_modify {bp_event {tracepoint 0}}
     method bp_delete {bp_event}
+    method _select_and_popup {bp X Y}
   }

 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]