1# File: debug.tcl
2
3# Purpose: the Debug Window for debugging
4
5#
6# Copyright (c) 1997-2001 Tim Baker
7#
8# This software may be copied and distributed for educational, research, and
9# not for profit purposes provided that this copyright and statement are
10# included in all such copies.
11#
12
13namespace eval NSDebug {
14
15	variable Priv
16	set Priv(font) [Global font,fixed,normal]
17
18	variable auto_lite 0
19	variable free_moves 0
20	variable see_monsters 0
21
22# namespace eval NSDebug
23}
24
25# NSDebug::InitModule --
26#
27#	One-time-only-ever initialization.
28#
29# Arguments:
30#	arg1					about arg1
31#
32# Results:
33#	What happened.
34
35proc NSDebug::InitModule {} {
36
37	variable Priv
38
39	# Create the Debug Window
40	NSObject::New NSDebug
41
42	return
43}
44
45# NSDebug::NSDebug --
46#
47#	Object constructor called by NSObject::New().
48#
49# Arguments:
50#	arg1					about arg1
51#
52# Results:
53#	What happened.
54
55proc NSDebug::NSDebug {oop} {
56
57	InitWindow $oop
58
59	set win [Info $oop win]
60
61	NSToplevel::NaturalSize $win ""
62
63	Info $oop display,current -1
64	Info $oop detail,current -1
65
66	if {[Platform windows]} {
67		wm withdraw $win
68	}
69	wm geometry $win +20+20
70	update idletasks
71	wm iconify $win
72
73	return
74}
75
76# NSDebug::Info --
77#
78#	Query and modify info.
79#
80# Arguments:
81#	arg1					about arg1
82#
83# Results:
84#	What happened.
85
86proc NSDebug::Info {oop info args} {
87
88	global NSDebug
89
90	# Set info
91	if {[llength $args]} {
92		switch -- $info {
93			default {
94				set NSDebug($oop,$info) [lindex $args 0]
95			}
96		}
97
98	# Get info
99	} else {
100		switch -- $info {
101			default {
102				return $NSDebug($oop,$info)
103			}
104		}
105	}
106
107	return
108}
109
110# NSDebug::InitWindow --
111#
112#	.
113#
114# Arguments:
115#	arg1					about arg1
116#
117# Results:
118#	What happened.
119
120proc NSDebug::InitWindow {oop} {
121
122	global NSDebug
123	variable Priv
124
125	set win .debug$oop
126	toplevel $win
127	wm title $win Debug
128
129	# Do stuff when window closes
130	wm protocol $win WM_DELETE_WINDOW "NSDebug::Close $oop"
131
132	Info $oop win $win
133
134	InitMenus $oop
135
136	# Divider
137	MakeDivider $win.divider x
138
139	# Tabs!
140	set tabsId [NSObject::New NSTabs $win]
141	foreach {hook label} $Priv(hook) {
142		NSTabs::Add $tabsId $label
143	}
144	NSTabs::Info $tabsId invokeCmd "NSDebug::InvokeTab $oop"
145	NSTabs::Info $tabsId active 1
146	Info $oop tabsId $tabsId
147
148	# List of monsters, objects, etc
149	set frame [frame $win.frameList -relief sunken -borderwidth 1]
150	set canvistId [NSObject::New NSTexist $frame $Priv(font) 60 10]
151	set canvas [NSTexist::Info $canvistId text]
152	$canvas configure -background [Value listBG] \
153		-yscrollcommand "$frame.yscroll set" \
154		-exportselection no
155	scrollbar $frame.yscroll \
156		-orient vertical -command "$canvas yview"
157
158	# Selection command
159	NSTexist::Info $canvistId selectionCmd \
160		"NSDebug::SelectionChanged_Display $oop"
161
162	Info $oop display,canvistId $canvistId
163
164	# This call updates the list background color whenever the
165	# global list background color changes
166	Info $oop display,clientId \
167		[NSValueManager::AddClient listBG "ListBackgroundChanged $canvas"]
168
169	pack $frame.yscroll -side right -fill y
170	pack $canvas -side left -expand yes -fill both -anchor nw
171
172	# Type list
173	set frame [frame $win.frameList2 -relief sunken -borderwidth 1]
174	set canvistId [NSObject::New NSTexist $frame $Priv(font) 60 9]
175	set canvas [NSTexist::Info $canvistId text]
176	$canvas configure -background [Value listBG] \
177		-yscrollcommand "$frame.yscroll set" \
178		-exportselection no
179	scrollbar $frame.yscroll \
180		-orient vertical -command "$canvas yview"
181
182	# Selection command
183	NSTexist::Info $canvistId selectionCmd \
184		"NSDebug::SelectionChanged_Detail $oop"
185
186	# Invoke command
187	NSTexist::Info $canvistId invokeCmd \
188		"NSDebug::Invoke_Detail $oop"
189
190	Info $oop detail,canvistId $canvistId
191
192	# This call updates the list background color whenever the
193	# global list background color changes
194	Info $oop detail,clientId \
195		[NSValueManager::AddClient listBG "ListBackgroundChanged $canvas"]
196
197	pack $frame.yscroll -side right -fill y
198	pack $canvas -side left -expand yes -fill both -anchor nw
199
200	#
201	# Edit-value entry
202	#
203
204	set frame $win.frameValue
205	frame $frame \
206		-borderwidth 0
207	label $frame.label \
208		-text "Value:"
209	entry $frame.entry \
210		-width 20 -font [Global font,fixed,normal]
211
212	bind $frame.entry <KeyPress-Return> \
213		"NSDebug::AcceptValue $oop"
214
215	pack $frame.label -side left
216	pack $frame.entry -side left
217
218	Info $oop valueEntry $frame.entry
219
220	#
221	# Statusbar
222	#
223
224	MakeStatusBar $win.statusBar 20
225
226	#
227	# Geometry
228	#
229
230	grid rowconfig $win 0 -weight 0 -minsize 0
231	grid rowconfig $win 1 -weight 0 -minsize 0
232	grid rowconfig $win 2 -weight 1 -minsize 0
233	grid rowconfig $win 3 -weight 0 -minsize 0
234	grid rowconfig $win 4 -weight 0 -minsize 0
235	grid rowconfig $win 5 -weight 0 -minsize 0
236	grid columnconfig $win 0 -weight 1 -minsize 0
237
238	if {[Platform windows]} {
239		grid $win.divider \
240			-row 0 -column 0 -rowspan 1 -columnspan 1 -sticky ew
241	}
242	grid [NSTabs::Info $tabsId canvas] \
243		-row 1 -column 0 -rowspan 1 -columnspan 1 -sticky ew
244	grid $win.frameList \
245		-row 2 -column 0 -rowspan 1 -columnspan 1 -sticky news
246	grid $win.frameList2 \
247		-row 3 -column 0 -rowspan 1 -columnspan 1 -sticky ew
248	grid $win.frameValue \
249		-row 4 -column 0 -rowspan 1 -columnspan 1 -sticky ew -pady 2
250	grid $win.statusBar \
251		-row 5 -column 0 -rowspan 1 -columnspan 1 -sticky ew
252
253	return
254}
255
256# NSDebug::InitMenus --
257#
258#	Create the menus.
259#
260# Arguments:
261#	arg1					about arg1
262#
263# Results:
264#	What happened.
265
266proc NSDebug::InitMenus {oop} {
267
268	set win [Info $oop win]
269
270	# Modifier key
271	set mod Ctrl
272
273	#
274	# Menu bar
275	#
276
277	set mbar [NSObject::New NSMenu $win -tearoff 0 \
278		-postcommand "NSDebug::SetupMenus $oop" -identifier MENUBAR]
279	Info $oop mbar $mbar
280
281	#
282	# Debug Menu
283	#
284
285	NSObject::New NSMenu $mbar -tearoff 0 -identifier MENU_DEBUG
286	NSMenu::MenuInsertEntry $mbar -end MENUBAR -type cascade \
287		-menu MENU_DEBUG -label Debug -underline 0 -identifier M_DEBUG
288
289	set entries {}
290	lappend entries [list -type command -label "New Window" -command "NSObject::New NSDebug" -accelerator $mod+N -underline 0 -identifier E_NEW]
291	lappend entries [list -type command -label "Debug Mode" -command "DoUnderlyingCommand ^A" -identifier E_DEBUG_MODE]
292	lappend entries [list -type command -label "Reload" -command "InitDebug $oop" -identifier E_INIT_DEBUG]
293	lappend entries [list -type separator]
294	lappend entries [list -type command -label "Close" -command "NSDebug::Close $oop" -accelerator $mod+W -underline 0 -identifier E_CLOSE]
295
296	NSMenu::MenuInsertEntries $mbar -end MENU_DEBUG $entries
297
298	#
299	# Character Menu
300	#
301
302	NSObject::New NSMenu $mbar -tearoff 0 -identifier MENU_CHARACTER
303	NSMenu::MenuInsertEntry $mbar -end MENUBAR -type cascade \
304		-menu MENU_CHARACTER -label Character -underline 0 \
305		-identifier M_CHARACTER
306
307	set entries {}
308	lappend entries [list -type separator]
309	lappend entries [list -type command -label "Cure All Maladies" \
310		-command "DoCommandIfAllowed ^Aa" -identifier E_CURE_ALL \
311		-accelerator a]
312	lappend entries [list -type checkbutton -label "Free Moves *" \
313		-command "debug command free_moves" -onvalue 1 -offvalue 0 \
314		-variable NSDebug::free_moves -identifier E_FREE_MOVES]
315	lappend entries [list -type command -label "Gain Experience" \
316		-command "DoCommandIfAllowed ^Ax" -identifier E_GAIN_EXPERIENCE \
317		-accelerator x]
318	lappend entries [list -type command -label "Phase Door" \
319		-command "DoCommandIfAllowed ^Ap" -identifier E_PHASE_DOOR \
320		-accelerator p]
321	lappend entries [list -type command -label "Rerate Hitpoints" \
322		-command "DoCommandIfAllowed ^Ah" -identifier E_RERATE_HITPOINTS \
323		-accelerator h]
324	lappend entries [list -type command -label "Self Knowledge" \
325		-command "DoCommandIfAllowed ^Ak" -identifier E_SELF_KNOWLEDGE \
326		-accelerator k]
327	lappend entries [list -type command -label "Teleport" \
328		-command "DoCommandIfAllowed ^At" -identifier E_TELEPORT \
329		-accelerator t]
330	lappend entries [list -type command -label "Teleport To Target" \
331		-command "DoCommandIfAllowed ^Ab" -identifier E_TELEPORT_TO_TARGET \
332		-accelerator b]
333	lappend entries [list -type command -label "Teleport To Location" \
334		-command "debug command teleport_to_location" \
335		-identifier E_TELEPORT_TO_LOCATION]
336
337	NSMenu::MenuInsertEntries $mbar -end MENU_CHARACTER $entries
338
339	#
340	# Dungeon Menu
341	#
342
343	NSObject::New NSMenu $mbar -tearoff 0 -identifier MENU_DUNGEON
344	NSMenu::MenuInsertEntry $mbar -end MENUBAR -type cascade \
345		-menu MENU_DUNGEON -label Dungeon -underline 0 -identifier M_DUNGEON
346
347	set entries {}
348	lappend entries [list -type checkbutton -label "Auto-Lite *" \
349		-command "debug command auto_lite" -onvalue 1 -offvalue 0 \
350		-variable NSDebug::auto_lite -identifier E_AUTO_LITE]
351	lappend entries [list -type command -label "Detection" \
352		-command "DoCommandIfAllowed ^Ad" -identifier E_DETECTION \
353		-accelerator d]
354	lappend entries [list -type command -label "Jump To Level" \
355		-command "DoCommandIfAllowed ^Aj" -identifier E_GOTO_LEVEL \
356		-accelerator j]
357	lappend entries [list -type command -label "Magic Mapping" \
358		-command "DoCommandIfAllowed ^Am" -identifier E_MAGIC_MAPPING \
359		-accelerator m]
360	lappend entries [list -type command -label "Wizard Dark" -command "" \
361		-identifier E_WIZARD_DARK]
362	lappend entries [list -type command -label "Wizard Lite" \
363		-command "DoCommandIfAllowed ^Aw" -identifier E_WIZARD_LITE \
364		-accelerator w]
365
366	NSMenu::MenuInsertEntries $mbar -end MENU_DUNGEON $entries
367
368	#
369	# Monster Menu
370	#
371
372	NSObject::New NSMenu $mbar -tearoff 0 -identifier MENU_MONSTER
373	NSMenu::MenuInsertEntry $mbar -end MENUBAR -type cascade \
374		-menu MENU_MONSTER -label Monster -underline 0 -identifier M_MONSTER
375
376	set entries {}
377	lappend entries [list -type command -label "Mass Genocide" -command "DoCommandIfAllowed ^Az" -identifier E_MASS_GENOCIDE -accelerator z]
378	lappend entries [list -type checkbutton -label "See Monsters *" -command "debug command see_monsters" -onvalue 1 -offvalue 0 -variable NSDebug::see_monsters -identifier E_SEE_MONSTERS]
379	lappend entries [list -type command -label "Summon Random" -command "DoCommandIfAllowed ^As" -identifier E_SUMMON_ANY -accelerator s]
380
381	NSMenu::MenuInsertEntries $mbar -end MENU_MONSTER $entries
382
383	#
384	# Object Menu
385	#
386
387	NSObject::New NSMenu $mbar -tearoff 0 -identifier MENU_OBJECT
388	NSMenu::MenuInsertEntry $mbar -end MENUBAR -type cascade \
389		-menu MENU_OBJECT -label Object -underline 0 -identifier M_OBJECT
390
391	set entries {}
392	lappend entries [list -type command -label "Acquire Good" -command "DoCommandIfAllowed ^Ag" -identifier E_ACQUIRE_GOOD -accelerator g]
393	lappend entries [list -type command -label "Acquire Very Good" -command "DoCommandIfAllowed ^Av" -identifier E_ACQUIRE_VERY_GOOD -accelerator v]
394	lappend entries [list -type command -label "Allocate Artifact" -command "" -identifier E_CREATE_ARTIFACT]
395	lappend entries [list -type command -label "Create Any" -command "" -identifier E_CREATE_OBJECT]
396	lappend entries [list -type command -label "Identify" -command "DoCommandIfAllowed ^Ai" -identifier E_IDENTIFY -accelerator i]
397	lappend entries [list -type command -label "Identify Fully" -command "^AI" -identifier E_IDENTIFY_FULLY -accelerator I]
398	lappend entries [list -type command -label "Identfy Many" -command "" -identifier E_IDENTIFY_MANY]
399	lappend entries [list -type command -label "Identify Pack" -command "" -identifier E_IDENTIFY_PACK]
400	lappend entries [list -type separator]
401	lappend entries [list -type command -label "Object List" -command "NSDebug::SetHook $oop debug_hook_object" -identifier E_OBJECT_LIST]
402
403	NSMenu::MenuInsertEntries $mbar -end MENU_OBJECT $entries
404
405	return
406}
407
408# NSDebug::SetupMenus --
409#
410#	Prepare to post the menus.
411#
412# Arguments:
413#	arg1					about arg1
414#
415# Results:
416#	What happened.
417
418proc NSDebug::SetupMenus {oop mbarID} {
419
420	set isCmd [expr {[string compare [angband inkey_flags] INKEY_CMD] == 0}]
421
422	# See if "debug" mode was entered
423	angband player cheat cheat
424
425	# Debug Menu
426	lappend identList E_NEW E_INIT_DEBUG E_CLOSE
427	if {!$cheat(debug)} {
428		lappend identList E_DEBUG_MODE
429	}
430
431	# Character Menu
432	if {$isCmd && $cheat(debug)} {
433		lappend identList E_CURE_ALL E_GAIN_EXPERIENCE E_RERATE_HITPOINTS \
434			E_PHASE_DOOR E_SELF_KNOWLEDGE E_TELEPORT E_TELEPORT_TO_TARGET \
435			E_TELEPORT_TO_LOCATION
436	}
437	lappend identList E_EQUIPMENT E_INVENTORY E_FREE_MOVES E_EDIT_CHARACTER
438
439	# Dungeon Menu
440	if {$isCmd && $cheat(debug)} {
441		lappend identList E_DETECTION E_GOTO_LEVEL E_MAGIC_MAPPING \
442			E_WIZARD_DARK E_WIZARD_LITE
443	}
444	lappend identList E_AUTO_LITE
445
446	# Monster Menu
447	if {$isCmd && $cheat(debug)} {
448		lappend identList E_MASS_GENOCIDE E_SUMMON_ANY
449	}
450	lappend identList E_SEE_MONSTERS E_MONSTER_LIST
451
452	# Object Menu
453	if {$isCmd && $cheat(debug)} {
454		lappend identList E_ACQUIRE_GOOD E_ACQUIRE_VERY_GOOD \
455			E_CREATE_ARTIFACT E_CREATE_OBJECT E_IDENTIFY E_IDENTIFY_FULLY \
456			E_IDENTIFY_MANY E_IDENTIFY_PACK
457	}
458	lappend identList E_OBJECT_LIST
459
460	NSMenu::MenuEnable $mbarID $identList
461
462	return
463}
464
465# NSDebug::Close --
466#
467#	Do something when closing the window.
468#
469# Arguments:
470#	arg1					about arg1
471#
472# Results:
473#	What happened.
474
475proc NSDebug::Close {oop} {
476
477	NSValueManager::RemoveClient listBG [Info $oop display,clientId]
478	NSValueManager::RemoveClient listBG [Info $oop detail,clientId]
479
480	destroy [Info $oop win]
481	NSObject::Delete NSDebug $oop
482
483	return
484}
485
486# NSDebug::SelectionChanged_Display --
487#
488#	Description.
489#
490# Arguments:
491#	arg1					about arg1
492#
493# Results:
494#	What happened.
495
496proc NSDebug::SelectionChanged_Display {oop canvistId select deselect} {
497
498	# Nothing was selected
499	if {![llength $select]} {
500
501		# Clear detail list
502		set canvistId [Info $oop detail,canvistId]
503		NSTexist::Delete $canvistId 0 end
504
505		# Clear statusbar
506		[Info $oop win].statusBar itemconfigure t2 -text ""
507
508		# No row is selected
509		Info $oop display,current -1
510
511		# Done
512		return
513	}
514
515	# Get the (first) row
516	set row [lindex $select 0]
517	Info $oop display,current $row
518
519	CallHook $oop select_display $row
520
521	return
522}
523
524# NSDebug::SelectionChanged_Detail --
525#
526#	Description.
527#
528# Arguments:
529#	arg1					about arg1
530#
531# Results:
532#	What happened.
533
534proc NSDebug::SelectionChanged_Detail {oop canvistId select deselect} {
535
536	# If nothing was selected, clear the detail list
537	if {![llength $select]} {
538		[Info $oop valueEntry] delete 0 end
539		Info $oop detail,current -1
540		return
541	}
542
543	# Get the (first) row
544	set row [lindex $select 0]
545	Info $oop detail,current $row
546
547	CallHook $oop select_detail $row
548
549	return
550}
551
552# NSDebug::Invoke_Detail --
553#
554#	Description.
555#
556# Arguments:
557#	arg1					about arg1
558#
559# Results:
560#	What happened.
561
562proc NSDebug::Invoke_Detail {oop canvistId x y} {
563
564	set row [NSTexist::PointToRow $canvistId $x $y]
565	if {$row == -1} return
566	CallHook $oop edit $row
567
568	return
569}
570
571# NSDebug::CallHook --
572#
573#	Call the hook.
574#
575# Arguments:
576#	arg1					about arg1
577#
578# Results:
579#	What happened.
580
581proc NSDebug::CallHook {oop message args} {
582
583	return [uplevel #0 NSDebug::[Info $oop hook] $oop $message $args]
584}
585
586# NSDebug::SetHook --
587#
588#	Set the hook. The hook controls what is displayed.
589#
590# Arguments:
591#	arg1					about arg1
592#
593# Results:
594#	What happened.
595
596proc NSDebug::SetHook {oop hook} {
597
598	variable Priv
599
600	Info $oop hook $hook
601
602	CallHook $oop open
603
604	set tabsId [Info $oop tabsId]
605	set current [NSTabs::Info $tabsId current]
606	set tabId [NSTabs::GetNthId $tabsId [expr {[lsearch -exact $Priv(hook) $hook] / 2}]]
607	if {$tabId != $current} {
608		NSTabs::Smaller $tabsId $current
609		NSTabs::Bigger $tabsId $tabId
610		NSTabs::Info $tabsId current $tabId
611	}
612
613	return
614}
615
616# NSDebug::CalcLineLength --
617#
618#	Return the number of characters that will fit on a line.#
619# Arguments:
620#	arg1					about arg1
621#
622# Results:
623#	What happened.
624
625proc NSDebug::CalcLineLength {oop} {
626
627	variable Priv
628
629	set canvistId [Info $oop display,canvistId]
630	set text [NSTexist::Info $canvistId text]
631
632	set cw [font measure $Priv(font) "W"]
633	set width [winfo width $text]
634	return [expr {int([expr {($width - 4) / $cw}])}]
635}
636
637# NSDebug::SetList_Display --
638#
639#	Clears the display list, then calls the hook to append rows to it.
640#
641# Arguments:
642#	arg1					about arg1
643#
644# Results:
645#	What happened.
646
647proc NSDebug::SetList_Display {oop} {
648
649	set canvistId [Info $oop display,canvistId]
650
651	# Feedback
652	StatusBar $oop "Displaying..." 0
653	update idletasks
654
655	# Clear the list
656	NSTexist::Delete $canvistId 0 end
657
658	# Call hook to set the display list
659	CallHook $oop set_list_display
660
661	# Number of matches
662	StatusBar $oop "Done." 1
663
664	# Hack -- Clear the detail list
665	set canvistId [Info $oop detail,canvistId]
666	NSTexist::Delete $canvistId 0 end
667
668	return
669}
670
671# NSDebug::SetList_Detail --
672#
673#	Clears the detail list, then calls the hook to append rows to it.
674#
675# Arguments:
676#	arg1					about arg1
677#
678# Results:
679#	What happened.
680
681proc NSDebug::SetList_Detail {oop} {
682
683	set canvistId [Info $oop detail,canvistId]
684
685	# Clear the list
686	NSTexist::Delete $canvistId 0 end
687
688	# Call hook to set the detail list
689	CallHook $oop set_list_detail
690
691	return
692}
693
694# NSDebug::UpdateList_Detail --
695#
696#	Set a row.
697#
698# Arguments:
699#	arg1					about arg1
700#
701# Results:
702#	What happened.
703
704proc NSDebug::UpdateList_Detail {oop row text color} {
705
706	set canvistId [Info $oop detail,canvistId]
707
708	# Delete old row
709	NSTexist::Delete $canvistId $row $row
710
711	# Insert row again
712	NSTexist::Insert $canvistId $row $text $color
713
714	# Select it
715	NSTexist::UpdateSelection $canvistId $row {}
716
717	return
718}
719
720# NSDebug::InvokeTab --
721#
722#	Called when a tab is clicked.
723#
724# Arguments:
725#	arg1					about arg1
726#
727# Results:
728#	What happened.
729
730proc NSDebug::InvokeTab {oop tabsId tabId} {
731
732	variable Priv
733
734	set index [lsearch -exact [NSTabs::Info $tabsId id] $tabId]
735	SetHook $oop [lindex $Priv(hook) [expr {$index * 2}]]
736
737	return
738}
739
740# NSDebug::StatusBar --
741#
742#	Displays text in the status bar, and optionally clears it later.
743#
744# Arguments:
745#	arg1					about arg1
746#
747# Results:
748#	What happened.
749
750proc NSDebug::StatusBar {oop text zap} {
751
752	set win [Info $oop win]
753	set label [$win.statusBar itemcget t1 -label]
754	$label configure -text $text
755	if {$zap} {
756		NSUtils::ZapLabel $label
757	}
758
759	return
760}
761
762# NSDebug::List_Inventory --
763#
764#	Display the character's inventory in the first list.
765#
766# Arguments:
767#	arg1					about arg1
768#
769# Results:
770#	What happened.
771
772proc NSDebug::ListInvOrEquip {oop invOrEquip} {
773
774	global NSDebug
775
776	set canvistId $NSDebug($oop,list)
777
778	# Clear the list
779	NSTexist::Delete $canvistId 0 end
780
781	# Get a list of items
782	set items [angband $invOrEquip find]
783
784	# Append each item
785	foreach index $items {
786
787		angband $invOrEquip info $index attrib
788		set desc $attrib(name)
789		set color [default_tval_to_attr $attrib(tval)]
790		set icon $attrib(icon)
791
792		NSTexist::Insert $canvistId end $desc $color
793	}
794
795	return
796}
797
798
799proc NSDebug::AcceptValue {oop} {
800
801	if {[Info $oop detail,current] == -1} return
802
803	set entry [Info $oop valueEntry]
804	set value [$entry get]
805	CallHook $oop accept_value $value
806
807	return
808}
809
810proc NSDebug::debug_hook_XXX {oop message args} {
811
812	switch -- $message {
813
814		open {
815		}
816
817		close {
818		}
819
820		select_display {
821		}
822
823		select_detail {
824		}
825
826		edit {
827		}
828	}
829
830	return
831}
832
833proc InitDebug {oop} {
834
835	catch {NSDebug::Close $oop}
836	NSModule::RebootModule NSDebug
837
838	return
839}
840