Updated 2012-01-10 13:19:21 by RLE


The above page appears to be describing a GUI creator. However, it is in French, and French isn't a language which I read.

Sarnold : This is indeed a GUI creator, as a framework that wraps geometry managers. With cells, it is easy to get good-looking GUI fast and in a few lines. cells is designed to place widgets with pixel-precision.
    package require cells
    package require xcells
    # a little size helper
    proc size {x} {
        expr 50*$x
    cells create . {
        # manager v : vertical placing (top to bottom)
        cells::config +manager v -width 200 -height 100 +title "Cells testing"
        # creates two 'cell' widgets, i.e. two new containers inside the toplevel
        cells::create cell ctrl(2)
        cells::with ctrl(0) {
            cells::config -height 50 -width 200
            # creates a simple text label
            cells::create label lbl(1) -text "Please confirm or cancel the operation."
        cells::with ctrl(1) {
            # horizontal placing (left to right)
            cells::config +manager h -height 50 -width 200 +pady 2 +padx 10
            # creates two xbutton widgets
            # xbutton widgets have width and height in pixels
            cells::create xbutton btn(2) -width [size 2] -height [size 0.5] \
                    +padx [size 0.2]
            cells::config btn(0) -text Confirm -command {exit} -height [size 0.5] -width 100
            cells::config btn(1) -text Cancel -command {exit} -height [size 0.5] -width 100