-
Notifications
You must be signed in to change notification settings - Fork 1
/
m3_help_about.pro
71 lines (70 loc) · 1.96 KB
/
m3_help_about.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
pro m3_help_about_event, event
compile_opt strictarr
;
; PURPOSE: Event handler for the "About" window.
;
;---------------------------------------------------------------------------------------------------
;
; simple (standard) error catching mechanism
;
CATCH, error
IF (error NE 0) THEN BEGIN
catch, /cancel
ok = m3_error_message()
return
ENDIF
;
widget_control, event.id, get_value=ButtonValue
if ButtonValue eq 'OK' then widget_control, event.top, /destroy
end
pro m3_help_about, event
compile_opt strictarr
;
; PURPOSE: Displays the Help, About window, which in turn tells you the version of m3tools you're
; using.
;
;--------------------------------------------------------------------------------------------------
;
; simple (standard) error catching mechanism
;
CATCH, error
IF (error NE 0) THEN BEGIN
catch, /cancel
ok = m3_error_message()
return
ENDIF
;
; get the version info
;
version=m3_utils_get_version()
;;
;; get ip address
;;
;idl_version=float(strmid(!version.RELEASE, 0, strpos(!version.RELEASE, '.', /reverse_search)))
;if idl_version ge 6.4 then begin
; oUrl = OBJ_NEW('IDLnetUrl')
; oUrl->SetProperty, timeout=15 ;die if no response in 15 sec
; ip_addr=string(oUrl->Get(url='http://ifconfig.me/ip', /buffer))
; obj_destroy, oUrl
; ip_str='Your IP address is '+ip_addr
;endif else ip_str=' '
ip_str=' ' ;blank space (don't try to get ip address)
;
; build label text
;
cr=string(13b)
text=cr + cr + ip_str + cr + cr + cr + cr + 'M3 Tools Version' + cr + cr + version + cr
;
; construct widget to display it
;
envi_center,xoff,yoff
tlb=widget_base(title='M3Tools',column=1, /base_align_center,xoffset=xoff, yoffset=yoff)
wl=widget_label(tlb,value=text, xsize=250, ysize=200,/align_center, /frame)
slb=widget_base(tlb,row=1,xsize=50)
ok=widget_button(slb,value='OK', xsize=45)
widget_control, tlb, /realize
;
; register event handler
;
xmanager, 'm3_help_about', tlb
end