2017-01-20

BaseXClient-Tcl

Source code:
BaseXClient-Tcl


Tcl client for BaseX database.

BaseX 是一個 XML 資料庫,我只是用來做某些簡單的測試。大部份的功能跟官方的 client 都有點像,不過還是有做一些簡化假設,但是整體上功能應該是差不多的(應該啦)。

2017-01-10

print tcl_platform info

使用 parray 列出來 tcl_platform 的資料:

parray tcl_platform

tcl_platform is an associative array whose elements contain information about the platform on which the application is running, such as the name of the operating system, its current release number, and the machine's instruction set.

2017-01-05

tkvlc: A demo to embed libVLC to Tk toolkit widget

Source code:
tkvlc


使用 OpenGL with C and Tcl/Tk 的方法,將 libVLC 內嵌在 Tk frame widget 內播放影片的方法。

我只有在 openSUSE 上測試。用來驗證這個方法的可行性。


更新:
有些說明沒有寫好,我重新推一個上去 Github。

更新:
會在 Windows build fail,更新 source code。

2017/01/09 更新:
使用 libvlc_media_get_duration 讀取影片的長度。如果在 libvlc_media_player_set_media 之後沒有播放前就讀取,讀到的長度會是 0。

解決的方法有二個,一個是 play 以後 stop,再讀取就會是正確值(就是要先做一小段播放的動作)。一個是 set_media 之後呼叫 libvlc_media_parse,在分析以後 meta info 就會被填寫為正確值,那之後取得的資料就會是正確的。

2017/01/09 更新:
增加更多的 command,並且更新 command 的組織方式。
將版本更新為 v0.3。

2017-01-04

OpenGL with C and Tcl/Tk

OpenGL with C and Tcl/Tk


很有趣的是,這篇文章其實指出了一個很有用的用法,就是拿到 HWND/XWindow ID 以後,我們就可以內嵌一些內容到一個 Tk 的 frame 內。

關鍵是 It involves making a frame widget in Tcl, and then passing its HWND to C to initialize the OpenGL rendering context.


而我猜不只是 OpenGL,具有類似方法的函式庫也可以這樣使用。

因為沒有真的實作過,所以還不確定這個技巧的可用性有多高,但是我直覺認為,這個方法可以結合不少外部函式庫來使用。