Devel-tcltkdb
view release on metacpan or search on metacpan
Xresources.sample view on Meta::CPAN
* Perl Tk Debugger XResources.
* Note... These resources are subject to change.
*
* Use 'xfontsel' to select different fonts.
*
* Append these resource to ~/.Xdefaults | ~/.Xresources
* and use xrdb -override ~/.Xdefaults | ~/.Xresources
* to activate them.
*/
ptkdb.frame*font: fixed /* Menu Bar */
ptkdb.frame2.frame1.rotext.font: fixed /* Code Pane */
ptkdb.toplevel.frame.textundo.font: fixed /* Eval Expression Entry Window */
ptkdb.toplevel.frame1.text.font: fixed /* Eval Expression Results Window */
ptkdb.toplevel.button.font: fixed /* "Eval..." Button */
ptkdb.toplevel.button1.font: fixed /* "Clear Eval" Button */
ptkdb.toplevel.button2.font: fixed /* "Clear Results" Button */
ptkdb.toplevel.button3.font: fixed /* "Clear Dismiss" Button */
Presents a list of the breakpoints current in use. The pushbutton
allows a breakpoint to be 'disabled' without removing it. Expressions
can be applied to the breakpoint. If the expression evaluates to be
'true'(results in a defined value that is not 0) the debugger will
stop the script. Pressing the 'Goto' button will set the text pane
to that file and line where the breakpoint is set. Pressing the
'Delete' button will delete the breakpoint.
=back
=head1 Menus
=head2 File Menu
=over
=item About...
Presents a dialog box telling you about the version of ptkdb. It
recovers your OS name, version of perl, version of Tcl/Tk, and some other
information
=item Open
Prompts for text to search for. Options include forward search,
backwards search, and regular expression searching.
=item Quit
Causes the debugger and the target script to exit.
=back
=head2 Control Menu
=over
=item Run
The debugger allows the script to run to the next breakpoint or until
the script exits.
=item Run To Here
until the current line has executed.
This feature can be turned on at startup by adding:
$DB::tcltkdb::stop_on_warning = 1 ;
to a .ptkdbrc file
=back
=head2 Data Menu
=over
=item Enter Expression
When an expression is entered in the "Enter Expression:" text box,
selecting this item will enter the expression into the expression
list. Each time the debugger stops this expression will be evaluated
and its result updated in the list window.
HINT: You can enter multiple expressions by separating them with commas.
=item Use Data::Dumper for Eval Window
Enables or disables the use of Data::Dumper for formatting the results
of expressions in the Eval window.
=back
=head2 Stack Menu
Maintains a list of the current subroutine stack each time the
debugger stops. Selecting an item from this menu will set the text in
the code window to that particular subourtine entry point.
=head2 Bookmarks Menu
Maintains a list of bookmarks. The booksmarks are saved in ~/.ptkdb_bookmarks
=over
=item Add Bookmark
Adds a bookmark to the bookmark list.
=back
* Perl Tk Debugger XResources.
* Note... These resources are subject to change.
*
* Use 'xfontsel' to select different fonts.
*
* Append these resource to ~/.Xdefaults | ~/.Xresources
* and use xrdb -override ~/.Xdefaults | ~/.Xresources
* to activate them.
*/
ptkdb.frame*font: fixed /* Menu Bar */
ptkdb.frame2.frame1.rotext.font: fixed /* Code Pane */
ptkdb.toplevel.frame.textundo.font: fixed /* Eval Expression Entry Window */
ptkdb.toplevel.frame1.text.font: fixed /* Eval Expression Results Window */
ptkdb.toplevel.button.font: fixed /* "Eval..." Button */
ptkdb.toplevel.button1.font: fixed /* "Clear Eval" Button */
ptkdb.toplevel.button2.font: fixed /* "Clear Results" Button */
ptkdb.toplevel.button3.font: fixed /* "Clear Dismiss" Button */
/*
$self->{main_window} = $self->{int}->mainwindow();
$self->{main_window}->geometry($ENV{'PTKDB_GEOMETRY'} || "800x600") ;
$self->{main_window}->bind('<Control-c>', \&DB::dbint_handler) ;
#
# Bind our 'quit' routine to a close command from the window manager (Alt-F4)
#
$self->{main_window}->protocol('WM_DELETE_WINDOW', sub { $self->close_ptkdb_window(); } );
# Menu bar
$self->setup_menu_bar();
#
# setup Frames
# Setup our Code, Data, and breakpoints
$self->setup_frames();
}
#
];
$mw->bind('<Alt-g>' => sub { $self->GotoLine() ; }) ;
$mw->bind('<Control-f>' => sub { $self->FindText() ; }) ;
$mw->bind('<Control-r>' => \&Devel::tcltkdb::DoRestart) ;
$mw->bind('<Alt-q>' => sub { $self->{'event'} = 'quit' } ) ;
$mw->bind('<Alt-w>' => sub { $self->close_ptkdb_window ; }) ;
# Control Menu
my $runSub = sub { $DB::step_over_depth = -1 ; $self->{'event'} = 'run' } ;
my $runToSub = sub { $DB::window->{'event'} = 'run' if $DB::window->SetBreakPoint(1) ; } ;
my $stepOverSub = sub { &DB::SetStepOverBreakPoint(0) ;
$DB::single = 1 ;
$DB::window->{'event'} = 'step' ;
} ;
# keys for step into a subroutine
for ('<Shift-F9>', '<Alt-s>', '<Button-3>') {
$mw->bind($_ => $stepInSub );
}
# return from a subroutine
for ('<Alt-u>', '<Control-Button-3>') {
$mw->bind($_ => $returnSub );
}
# Data Menu
my $items3 = [ [ 'command' => 'Enter Expression', -accelerator => 'Alt+E', -command => sub { $self->EnterExpr() } ],
[ 'command' => 'Delete Expression', -accelerator => 'Ctrl+D', -command => sub { $self->deleteExpr() } ],
[ 'command' => 'Delete All Expressions', -command => sub {
$self->deleteAllExprs() ;
$self->{'expr_list'} = [] ; # clears list by dropping ref to it, replacing it with a new one
} ],
'-',
[ 'command' => 'Expression Eval Window...', -accelerator => 'F8', -command => sub { $self->setupEvalWindow() ; } ],
];
$mw->bind('<Alt-e>' => sub { $self->EnterExpr() } ) ;
$mw->bind('<Control-d>' => sub { $self->deleteExpr() } );
$mw->bind('<F8>', sub { $self->setupEvalWindow() ; }) ;
#
# Windows Menu
#
my $bsub = sub { $self->{'text'}->focus() };
my $csub = sub { $self->{'quick_entry'}->focus() };
my $dsub = sub { $self->{'entry'}->focus() };
my $items4 = [ [ 'command' => 'Code Pane', -accelerator => 'Alt+0', -command => $bsub ],
[ 'command' => 'Quick Entry', -accelerator => 'F9', -command => $csub ],
[ 'command' => 'Expr Entry', -accelerator => 'F11', -command => $dsub ]
];
$mw->bind('<Alt-0>', $bsub);
$mw->bind('<F9>', $csub);
$mw->bind('<F11>', $dsub);
my $menu = $mw->Menu(-menuitems => [
[Cascade=>'File', -tearoff => 0, -underline=>0, -menuitems=>$items1],
[Cascade=>'Control', -tearoff=>0, -underline=>0, -menuitems => $items2],
[Cascade=>'Data', -tearoff=>0, -menuitems => $items3, -underline => 0],
[Cascade=>'Stack', -tearoff=>0, -underline => 2],
[Cascade=>'Bookmarks', -tearoff=>0, -underline=>0],
[Cascade=>'Windows', -tearoff=>0, -menuitems => $items4]
]);
#
# Stack menu
$self->{stack_menu} = $int->widget($menu->entrycget(4,'-menu'),'Menubutton');
#
# Bookmarks menu
$self->{bookmarks_menu} = $int->widget($menu->entrycget(5,'-menu'),'Menubutton');
$self->setup_bookmarks_menu();
$mw->config(-menu=>$menu);
#
# Bar for some popular controls
my $bb = $mw->Frame()->pack(-side => 'top');
$bb->Button(-text => "Step In", @Devel::tcltkdb::button_font,
$self->{'text'}->tagAdd('search_tag', @{$self->{search_tag}}) ;
} # end of text found
$entry->_selectionRange(0, 'end');
} # end of FindSearch
#
# Support for the Find Text... Menu command
#
sub FindText {
my ($self) = @_ ;
my ($okayBtn);
#
# if we already have the Find Text Window open don't bother openning
# another, bring the existing one to the front.
if( $self->{find_window} ) {
$self->{find_window}->raise();
( run in 0.969 second using v1.01-cache-2.11-cpan-49f99fa48dc )