TclApps Library Source Code
Check-in [21449c368f]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add standalone support to askleo
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 21449c368f589fa49870422aa7da71b48a7f5426
User & Date: rmax 2011-01-06 17:15:41
Context
2011-03-23
17:31
* tkchat.tcl (::tkchat::parseStr): Render words of 10..40 characters as links to fossil artifact IDs on core.tcl.tk. check-in: c2dfc15db5 user: rmax tags: trunk
2011-01-06
17:15
Add standalone support to askleo check-in: 21449c368f user: rmax tags: trunk
2010-11-16
09:46
* askleo/askleo.tcl: Adjust code to the latest API changes on http://pda.leo.org and improve the UI. check-in: 77d4dd2a12 user: rmax tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to apps/tkchat/ChangeLog.






1
2
3
4
5
6
7




2010-11-16  Reinhard Max  <[email protected]>

	* askleo/askleo.tcl: Adjust code to the latest API changes on
	http://pda.leo.org and improve the UI.

2010-09-17  Reinhard Max  <[email protected]>

>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2011-01-06  Reinhard Max  <[email protected]>

	* askleo/askleo.tcl: Complete the API adjustments and add support
	for running askleo.tcl as a standalone application.

2010-11-16  Reinhard Max  <[email protected]>

	* askleo/askleo.tcl: Adjust code to the latest API changes on
	http://pda.leo.org and improve the UI.

2010-09-17  Reinhard Max  <[email protected]>

Changes to apps/tkchat/askleo/askleo.tcl.

39
40
41
42
43
44
45
46
47
48
49
50
51
52

53





54
55
56
57
58
59
60
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149




150

151
152
153
154
155
156
157
...
176
177
178
179
180
181
182

183

184
185
186
187
188
189
190
...
218
219
220
221
222
223
224







    variable td
    variable table
    variable tdcounter

    switch -- $close$tag {

	/TR - /tr {
	    if {[info exists td(2)] && [info exists td(3)]} {
		lappend table [string trim $td(2)] [string trim $td(3)]
	    }
	    set tdcounter 0
	    array unset td
	}


	td - td { incr tdcounter }






	default {
	    set item [htmlparse::mapEscapes $body]
	    if {[string length $item]} {
		append td($tdcounter) $item
	    }
	}
................................................................................
        }
    }
    $w configure -state disabled
    if {![winfo ismapped $dialog]} {wm deiconify $dialog} else {raise $dialog}
    $w configure -cursor ""
}

proc ::dict.leo.org::init {} {
    variable dialog
    variable textwidget
    variable LEOlogo
    set NS {}
    if {[package vsatisfies [package provide Tk] 8.5]} { set NS ::ttk }

    catch {destroy $dialog}
    image create photo LEOlogo -data $LEOlogo
    
    toplevel $dialog -class AskLEO
    wm withdraw $dialog
    wm title $dialog "askLEO"




    wm protocol $dialog WM_DELETE_WINDOW [list wm withdraw $dialog]


    set f [${NS}::frame $dialog.main]
    ${NS}::frame  $f.top
    ${NS}::entry  $f.top.ent -background white -font {Helvetica 12} \
        -textvariable [namespace current]::Query
    ${NS}::button $f.top.but -text "ask LEO" -command [namespace code askLEO]

................................................................................

    grid $f -sticky news
    grid rowconfigure $dialog 0 -weight 1
    grid columnconfigure $dialog 0 -weight 1

    bind $f.top.ent <Return> [list $f.top.but invoke]
    bind $f.bot.text <Button-2> [namespace code askLEOforSelection]

    bind $dialog <Double-Button-3> [list wm withdraw $dialog]

    focus $f.top.ent
}

proc ::dict.leo.org::show {} {
    variable dialog
    if {![winfo exists $dialog]} {init}
    toplevel $dialog.icon -background ""
................................................................................
    URRFUUBAAU7gPJDyOM4DOovzAE7gRABFURRFURRFURRFUVQBUAXoRIDzAM4DBY4TOJHjBE5B
    URRFURRFUSBFURRFURRFBU7hBM4DBY4zEI7zAFQAgBRFURRFURRFURRFURRFUURAAYUDBcQD
    AhQVOBFAURRFURRFURRFURRFURRFURRIARQlPABFARRFUQFBURRFURRFURRFUSBFURRFURRF
    URRFUQVFURRFURRFURRFgRRFURRFURQVAgA7
}

package provide askleo 1.1













|
|





>
|
>
>
>
>
>







 







|










<

>
>
>
>
|
>







 







>
|
>







 







>
>
>
>
>
>
>
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
...
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

154
155
156
157
158
159
160
161
162
163
164
165
166
167
...
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    variable td
    variable table
    variable tdcounter

    switch -- $close$tag {

	/TR - /tr {
	    if {[info exists td(1)] && [info exists td(2)]} {
		lappend table [string trim $td(1)] [string trim $td(2)]
	    }
	    set tdcounter 0
	    array unset td
	}

	TD - td {
            incr tdcounter
	    set item [htmlparse::mapEscapes $body]
	    if {[string length $item]} {
		append td($tdcounter) $item
	    }
        }

	default {
	    set item [htmlparse::mapEscapes $body]
	    if {[string length $item]} {
		append td($tdcounter) $item
	    }
	}
................................................................................
        }
    }
    $w configure -state disabled
    if {![winfo ismapped $dialog]} {wm deiconify $dialog} else {raise $dialog}
    $w configure -cursor ""
}

proc ::dict.leo.org::init {{standalone 0}} {
    variable dialog
    variable textwidget
    variable LEOlogo
    set NS {}
    if {[package vsatisfies [package provide Tk] 8.5]} { set NS ::ttk }

    catch {destroy $dialog}
    image create photo LEOlogo -data $LEOlogo
    
    toplevel $dialog -class AskLEO

    wm title $dialog "askLEO"
    if {$standalone} {
	wm protocol $dialog WM_DELETE_WINDOW exit
    } else {
	wm withdraw $dialog
	wm protocol $dialog WM_DELETE_WINDOW [list wm withdraw $dialog]
    }

    set f [${NS}::frame $dialog.main]
    ${NS}::frame  $f.top
    ${NS}::entry  $f.top.ent -background white -font {Helvetica 12} \
        -textvariable [namespace current]::Query
    ${NS}::button $f.top.but -text "ask LEO" -command [namespace code askLEO]

................................................................................

    grid $f -sticky news
    grid rowconfigure $dialog 0 -weight 1
    grid columnconfigure $dialog 0 -weight 1

    bind $f.top.ent <Return> [list $f.top.but invoke]
    bind $f.bot.text <Button-2> [namespace code askLEOforSelection]
    if {!$standalone} {
	bind $dialog <Double-Button-3> [list wm withdraw $dialog]
    }
    focus $f.top.ent
}

proc ::dict.leo.org::show {} {
    variable dialog
    if {![winfo exists $dialog]} {init}
    toplevel $dialog.icon -background ""
................................................................................
    URRFUUBAAU7gPJDyOM4DOovzAE7gRABFURRFURRFURRFUVQBUAXoRIDzAM4DBY4TOJHjBE5B
    URRFURRFUSBFURRFURRFBU7hBM4DBY4zEI7zAFQAgBRFURRFURRFURRFURRFUURAAYUDBcQD
    AhQVOBFAURRFURRFURRFURRFURRFURRIARQlPABFARRFUQFBURRFURRFURRFUSBFURRFURRF
    URRFUQVFURRFURRFURRFgRRFURRFURQVAgA7
}

package provide askleo 1.1

if {$argv0 eq [info script]} {
    # We're running standalone
    package require askleo
    ::dict.leo.org::init 1
    wm withdraw .
}