Skip to content

Commit 290da6d

Browse files
author
Matthias Kastner
committed
bugfix: markAsInitialized
since igor7 the BeforeQuitHook does not save the panel userdata element. we use global variables instead to sail around that :-(
1 parent 5eb9f6f commit 290da6d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

procedures/CodeBrowser_gui.ipf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,27 +186,25 @@ Function markAsUnInitialized()
186186
return 0
187187
endif
188188

189-
SetWindow $panel, userdata($oneTimeInitUserData)=""
189+
setGlobalVar("initialized", 0)
190190
debugPrint("panel marked as uninitialized")
191191
End
192192

193193
Function markAsInitialized()
194-
195194
if(!existsPanel())
196195
return 0
197196
endif
198197

199-
SetWindow $panel, userdata($oneTimeInitUserData)="1"
198+
setGlobalVar("initialized", 1)
200199
debugPrint("panel marked as initialized")
201200
End
202201

203202
Function isInitialized()
204-
205203
if(!existsPanel())
206204
return 0
207205
endif
208206

209-
return cmpstr(GetUserData(panel,"",oneTimeInitUserData),"1") == 0
207+
return getGlobalVar("initialized") == 1
210208
End
211209

212210
// Returns the currently selected item from the panel defined by the optional arguments.

procedures/CodeBrowser_hooks.ipf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Function killPanelRelatedObjects()
100100

101101
KillWaves/Z decl, line
102102
killGlobalStr("search")
103+
killGlobalVar("initialized")
103104
End
104105

105106
Function panelHook(s)

0 commit comments

Comments
 (0)