Skip to content

Commit 412aa14

Browse files
author
oberdorfer
committed
theme related mod's done
1 parent 725bd10 commit 412aa14

File tree

3 files changed

+526
-252
lines changed

3 files changed

+526
-252
lines changed

pagesmgr.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ------------------------------------------------------------------------------
22
# pagesmgr.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: pagesmgr.tcl,v 1.6 2003/10/20 21:23:52 damonc Exp $
4+
# $Id: pagesmgr.tcl,v 1.61 2009/09/06 21:28:51 oberdorfer Exp $
55
# ------------------------------------------------------------------------------
66
# Index of commands:
77
# - PagesManager::create
@@ -26,7 +26,7 @@ namespace eval PagesManager {
2626
Widget::define PagesManager pagesmgr
2727

2828
Widget::declare PagesManager {
29-
{-background TkResource "" 0 frame}
29+
{-background Color "SystemWindow" 0}
3030
{-cursor TkResource "" 0 frame}
3131
{-width Int 0 0 "%d >= 0"}
3232
{-height Int 0 0 "%d >= 0"}
@@ -50,7 +50,6 @@ proc PagesManager::create { path args } {
5050
set data(cpt) 0
5151
set data(realized) 0
5252

53-
# --- creation du canvas -----------------------------------------------------------------
5453
eval canvas $path -relief flat -bd 0 -highlightthickness 0 \
5554
[Widget::subcget $path :cmd]
5655

@@ -110,7 +109,8 @@ proc PagesManager::add { path page } {
110109

111110
lappend data(pages) $page
112111

113-
frame $path.f$page -relief flat \
112+
BWidget::wrap \
113+
frame $path.f$page -relief flat \
114114
-background [Widget::cget $path -background] -borderwidth 0
115115

116116
return $path.f$page

panedw.tcl

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# panedw.tcl
33
# This file is part of Unifix BWidget Toolkit
4+
# $Id: panedw.tcl,v 1.15 2009/09/06 21:29:34 oberdorfer Exp $
45
# ----------------------------------------------------------------------------
56
# Index of commands:
67
# - PanedWindow::create
@@ -34,13 +35,20 @@ namespace eval PanedWindow {
3435
{-side Enum top 1 {top left bottom right}}
3536
{-width Int 10 1 "%d >=3"}
3637
{-pad Int 4 1 "%d >= 0"}
37-
{-background TkResource "" 0 frame}
38+
{-background Color "SystemWindowFrame" 0}
3839
{-bg Synonym -background}
3940
{-activator Enum "" 1 {line button}}
4041
{-weights Enum extra 1 {extra available}}
4142
}
4243

4344
variable _panedw
45+
46+
if { [BWidget::using ttk] } {
47+
if {[lsearch [bindtags .] PanedWThemeChanged] < 0} {
48+
bindtags . [linsert [bindtags .] 1 PanedWThemeChanged]
49+
}
50+
}
51+
4452
}
4553

4654

@@ -52,8 +60,9 @@ proc PanedWindow::create { path args } {
5260
variable _panedw
5361

5462
Widget::init PanedWindow $path $args
63+
frame $path -background [Widget::cget $path -background] \
64+
-class PanedWindow
5565

56-
frame $path -background [Widget::cget $path -background] -class PanedWindow
5766
set _panedw($path,nbpanes) 0
5867
set _panedw($path,weights) ""
5968
set _panedw($path,configuredone) 0
@@ -73,6 +82,12 @@ proc PanedWindow::create { path args } {
7382
bind $path <Configure> [list PanedWindow::_realize $path %w %h]
7483
bind $path <Destroy> [list PanedWindow::_destroy $path]
7584

85+
if { [BWidget::using ttk] } {
86+
bind PanedWThemeChanged <<ThemeChanged>> \
87+
"+[namespace current]::_themechanged $path"
88+
}
89+
90+
7691
return [Widget::create PanedWindow $path]
7792
}
7893

@@ -383,3 +398,16 @@ proc PanedWindow::_destroy { path } {
383398
unset _panedw($path,nbpanes)
384399
Widget::destroy $path
385400
}
401+
402+
403+
# ----------------------------------------------------------------------------
404+
# Command PanedWindow::_themechanged
405+
# ----------------------------------------------------------------------------
406+
proc PanedWindow::_themechanged { path } {
407+
408+
if { ![winfo exists $path] } { return }
409+
BWidget::set_themedefaults
410+
411+
$path configure \
412+
-background $BWidget::colors(SystemWindowFrame)
413+
}

0 commit comments

Comments
 (0)