tk table

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi all,

I have a variable which has some comp ids.

I need to diplay them as a tk table with some buttons .

The buttons has to be for some purposes.

can any one hlp with this.

 

Thanks,

Mahes

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited September 2017

    You can use tk table (refer to tk manual https://www.tcl.tk/man/

    or hwtk::table (read usage in start>all program>altairhyperworks>tools>HWTK Gui Toolkit)

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2017

    Thanks tinh.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2017

    Hi all,

    invalid command name 'hwtk::demo::getpreviewframe'
    invalid command name 'hwtk::demo::getpreviewframe'
        while executing
    'hwtk::demo::getpreviewframe'
        invoked from within
    'set w [hwtk::demo::getpreviewframe]'
        (file 'D:/mahez/13Sep17/but.tcl' line 1)
        invoked from within
    'source {D:/mahez/13Sep17/but.tcl}'
        ('uplevel' body line 1)
        invoked from within
    'uplevel #0 'source {$file}''
        (procedure '::HM_Framework::p_FileLoad' line 68)
        invoked from within
    '::HM_Framework::p_FileLoad 24'
        ('eval' body line 1)
        invoked from within
    '# Compiled -- no source code available
    error 'called a copy of a compiled script''
        (procedure '::hwt::ReleaseCanvasButton' line 1)
        invoked from within
    '::hwt::ReleaseCanvasButton 0 ._Scripting.f35.button35'
        (command bound to event)

     

     

     

     

     

    m getting above error ..y

  • tinh
    tinh Altair Community Member
    edited September 2017

    Please show your but.tcl file

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2017

    Please show your but.tcl file

    I just copied and pasted from that hw toolkit.

    no changes

    just to understand

     

     

    package require hwat;
    set w [hwtk::demo::getpreviewframe]

    catch {destroy .top}
    set w [hwtk::dialog .top]
    $w hide apply
    set recess [$w recess]

    namespace eval ::texample {}

    proc ::texample::OnSelect {W S c} {
        puts [info level 0]
    }

    proc ::texample::OnOk {w T} {
        puts 'Selected items are --> [$T selectionget ]'
        $w unpost
    }

    set sl [hwtk::selectlist $recess.sl -stripes 1 -selectmode multiple -selectcommand '::texample::OnSelect %W %S %c']
    pack $sl -fill both -expand true
    $sl columnadd entities -text Entity
    $sl columnadd id -text ID
    $sl columnadd color -image palette-16.png
    $sl columnadd thickness -text Thickness

    for {set i 0} {$i < 100} {incr i} {
        set clr [expr {int(rand()*64)}]
        $sl rowadd row$i -values

    1. thickness $i.$i$i]
      }

    $w buttonconfigure ok -command '::texample::OnOk $w $recess.sl'
    $w post

  • tinh
    tinh Altair Community Member
    edited September 2017

    The proc is defined in hwtk toolkit GUI, not in hypermesh. So it raises error when you run it in hm

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2017

    hi tinh,

    thanks .

    I will find way to correct. :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />