Skip to content

Commit

Permalink
tile->ttk on demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Geballin committed Aug 24, 2022
1 parent e7daccb commit ecbf506
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions demos/StyleIntrospection.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
## This demo shows information about the Gtk/GNOME style currently in use.
##
###############################################################################
if {[catch {package require Ttk}]} {
package require tile
}
ttk::setTheme tilegtk
package require Tk
ttk::setTheme gtkTtk

set win {}
label $win.lbl_option -text Option:
Expand All @@ -23,7 +21,7 @@ foreach base {fg bg base text light mid dark text_aa} {
label $win.$base -text "$base:" -anchor w
grid $win.$base -row $row -column $col
foreach state {NORMAL PRELIGHT ACTIVE SELECTED INSENSITIVE} {
set colour [ttk::theme::tilegtk::currentThemeColour ${base}($state)]
set colour [ttk::theme::gtkTtk::currentThemeColour ${base}($state)]
label $win.${base}_$state -background $colour \
-relief raised -borderwidth 1
label $win.${base}_${state}_value -text $colour
Expand Down
10 changes: 5 additions & 5 deletions demos/autocomplete.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# $Id: autocomplete.tcl,v 1.1 2008/08/03 14:52:09 petasis Exp $
#
# Demonstration of inline auto-completion for Tile combobox widgets.
# Demonstration of inline auto-completion for Ttk combobox widgets.
#
# Usage:
#
Expand All @@ -16,25 +16,25 @@
# overhead.
#

namespace eval tile::combobox {
namespace eval ttk::combobox {
namespace export enableAutocomplete
}

## enableAutocomplete
#
# Enable inline auto-completion for the specified combobox widget.
#
proc tile::combobox::enableAutocomplete { w {presorted 1} } {
proc ttk::combobox::enableAutocomplete { w {presorted 1} } {
bind $w <KeyPress> [namespace code [list DoAutoComplete %W %A $presorted]]
}

## DoAutoComplete
#
# Perform inline auto-completion of typed text in the combobox.
#
proc tile::combobox::DoAutoComplete { w s presorted } {
proc ttk::combobox::DoAutoComplete { w s presorted } {
set old [$w get]
tile::entry::Insert $w $s
ttk::entry::Insert $w $s
set new [$w get]

# Only auto-complete if the string length has changed due to insertion.
Expand Down

0 comments on commit ecbf506

Please sign in to comment.