From 631c4ea0d0daa33317f9863df553b5a2377acdd4 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Fri, 21 Dec 2001 21:36:21 +0000 Subject: * library/bpwin.ith (_select_and_popup): New private method. * library/bpwin.itb (bp_select): Don't bind to Button-3. (build_win): Bind Button-3 to _select_and_popup. (_select_and_popup): New private method. --- gdb/gdbtk/ChangeLog | 7 +++++++ gdb/gdbtk/library/bpwin.itb | 22 ++++++++++++++++------ gdb/gdbtk/library/bpwin.ith | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index d7d4c8d940c..b19314bc26e 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,10 @@ +2001-12-21 Keith Seitz + + * library/bpwin.ith (_select_and_popup): New private method. + * library/bpwin.itb (bp_select): Don't bind to Button-3. + (build_win): Bind Button-3 to _select_and_popup. + (_select_and_popup): New private method. + 2001-12-18 Keith Seitz * library/memwin.itb (incr_addr): Fix typo. diff --git a/gdb/gdbtk/library/bpwin.itb b/gdb/gdbtk/library/bpwin.itb index 904504500b6..cb6377758ac 100644 --- a/gdb/gdbtk/library/bpwin.itb +++ b/gdb/gdbtk/library/bpwin.itb @@ -265,6 +265,7 @@ body BpWin::bp_add {bp_event {tracepoint 0}} { foreach thing $zz { bind $twin.${thing}${i} <1> "$this bp_select $i" bind $twin.${thing}${i} "$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} { @@ -426,6 +421,21 @@ body BpWin::bp_select { r } { 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 +} + # ------------------------------------------------------------------ # METHOD: bp_modify - modify a breakpoint entry # ------------------------------------------------------------------ diff --git a/gdb/gdbtk/library/bpwin.ith b/gdb/gdbtk/library/bpwin.ith index 9c6740a95fa..43d93cb990e 100644 --- a/gdb/gdbtk/library/bpwin.ith +++ b/gdb/gdbtk/library/bpwin.ith @@ -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} } } -- cgit v1.2.1