Setting widget properties as configurable options

Whilst the base widget set has configurable options sometimes its necessary to tweek the properties settings for a specific object. Styles are usually used to modify the overall theme of the UI, but its nice to work with it to get just what we want. For those working with the gnocl source code, there is a helper function called setStylProperty which will do the job. The following line is taken from the treeList.c module and shows how the horizontal width between columns can be adjusted.

    if {*opt->propName == 'H' } {
        setStyleProperty ( "GtkTreeView", "horizontal-separator", Tcl_GetString ( opt->val.obj ) );
    }

Changing style settings on the Tcl side is also possible using, the gnocl::setStyle command,

gnocl::setStyle GtkPaned "handle-size" 15

It should be noted however, that the style changes will only be applied to widgets created after the gnocl::setStyle command is called.
Comments