顯示具有 Tk 標籤的文章。 顯示所有文章
顯示具有 Tk 標籤的文章。 顯示所有文章

2021-07-05

tcl-awthemes

tcl-awthemes 簡介:

awdark and awlight themes for Tk, loosely based on the adwaita themes. Scalable themes: awdark, awlight, black, winxpblue, breeze, arc, clearlooks.


我發現有些 Linux Distribution 有包這個 套件,所以寫了 tcl-awthemes-spec 用來打包成 RPM 檔案並且在 openSUSE 使用。

2018-06-13

ttk::setTheme

ttk::setTheme

This function takes a theme name as an argument. It looks to see if the theme has been loaded, and if not, requires the package, and calls ttk to use the theme. While the code actually also sets a variable, that variable is local to the function and thus isn't available.

可以使用這個函式來設定 Ttk 要使用的 theme。


關於相關的 theme 列表,可以查看 List of ttk Themes。Ttk 已經有內建一些 theme 可以使用。

2018-06-07

tklib spec

tklib-spec (20180605)


因為 tablelist package 的關係,所以我也更新了 tklib 的 RPM spec。執行 build.tcl 就會 checkout 在 Github 的 mirror (@ 20180605) 並且進行處理,然後使用 rpmbuild 製造出 RPM 檔案。

這樣 tklib 所包含的 tablelist package 應該就是最近 release 的。

2018-06-06

tablelist 6.2

tablelist @ Tclers Wiki!
tablelist-spec


tablelist is a multi-column listbox and treeview widget for Tk.

Tklib 已經有納入這個套件,不過這個套件本身仍然在繼續修正問題與增加功能,然後(應該有)同步到 Tklib。

因為 tablelist 和 Tklib 的進版速度是不同的,所以 tablelist 我也寫了 RPM spec(嗯…… 其實是我一開始沒發覺他已經在 Tklib 裡了),這樣如果要使用較新的版本或者是需要單獨安裝的使用可以使用。

2009-10-23

清除掉 Visual C++ 2008 Express 最近使用的專案列表

package require registry

label .show -text "Below is the list:"
grid .show -row 0 -column 0 -columnspan 2 -pady 3 -ipady 1

set count 0
set rootKey "HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\9.0\\ProjectMRUList"

foreach id [registry values $rootKey] {
if {[string length $id] >= 4} {
set text [registry get $rootKey $id]
ttk::checkbutton .$count -text $text -variable check($id)
grid .$count -column 0 -columnspan 4 -ipady 1 -sticky nsew
set check($id) 0
incr count 1
}
}

proc doClean {} {
foreach id [registry values $::rootKey] {
if {[string length $id] >= 4} {
if {$::check($id) == 1} {
registry delete $::rootKey $id
}
}
}

exit
}

# Let our button in next row
incr count 1

button .exit -text "Exit" -command exit
grid .exit -column 2 -row $count -pady 3 -ipady 1 -sticky nsew
button .clean -text "Clean" -command doClean
grid .clean -column 3 -row $count -pady 3 -ipady 1 -sticky nsew
使用 checkbutton 建立列表,讓使用者選擇要清除最近使用的專案列表中的哪一個。我們使用一個陣列記住目前使用者的選擇,如果使用者按 Clean,就去清掉使用者所選擇的那些項目。

Geometry Manager 使用 grid 來管理。

2009-06-28

GIF photo images written with LZW compression

Tk 在 8.6 除了加入 PNG 格式的支援,同時因為 LZW 演算法專利已經過期,所以 Tk 8.6 也會加入 GIF photo images written with LZW compression 的支援。
下面是一些資訊:
"Unisys U.S. LZW Patent No. 4,558,302 expired on June 20, 2003, the counterpart patents in the United Kingdom, France, Germany and Italy expired on June 18, 2004, the Japanese counterpart patents expired on June 20, 2004 and the counterpart Canadian patent expired on July 7, 2004."
IBM 也握有 LZW 的專利,但是根據 GNU GIF 的網頁,IBM 的專利也將於 2006/10 到期,也就是說,實作的人將不用擔心觸碰到 LZW 專利地雷。
雖然我們有了 PNG,但是能夠使用 GIF 也不錯。