Custom toolbar creation in HyperView

User: "vipin_22401"
Altair Community Member
Updated by vipin_22401

Hi all,

Is it possible to create a custom toolbar in Hyperview?

I know it is possible in Hypermesh using the CreateMinibar command. I am looking for similar option in Hyperview.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "tinh"
    Altair Community Member
    Accepted Answer
    Updated by tinh

    Hi Vipin,

    there is a command can be used to make hyperview toolbar, '::hw::HwToolbar'

    but unlucky, it is not documented!

    outer wrapping command is ::hwtb::toolbar but it seems to be not completed (please check it with HW2020, i don't have this version)

     

    If aboves are not applicable, you can easily make your own toolbar, using ::hwtk::toolbutton to create toolbar buttons, and pack them in a frame, finally pack the frame (toolbar) on HV GUI

    Do not pack your own toolbar on HV dock frames because they are handled by HV GUI mechanism,

    pack your toolbar in HV center frame, example:

    proc mytoolbar {name items} { 	if {[regexp -nocase {^[a-z 0-9_]$} $name]} { 		return -code error "invalid toolbar name '$name'. Should contains only a-z, 0-9, _" 	} 	set tbw ._Tb_[string map {" " ""} $name] 	if {![winfo exists $tbw]} { 		frame $tbw 		pack $tbw {*}[pack info .mainFrame.center.f3.topMessageBar] -before .mainFrame.center.f3.topMessageBar 	} 	eval destroy [winfo child $tbw] 	pack [label $tbw.hdl -image classicToolbarHandleVertical.png -compound left] -side left -anchor w 	foreach item $items { 		::hwtk::[lindex $item 0] $tbw.item[incr i] {*}[lrange $item 1 end] 		pack $tbw.item$i -side left -anchor w 	} }  #example: foreach imageFile {entityElementsRigidSliding-24.png entityElementsRod-24.png entityElementsSpring-24.png entityElementsTetra4-24.png} { 	set imageFile [::hwt::CacheImage $imageFile] } proc action args {tk_messageBox -title "My Toolbar" -message $args} mytoolbar "New Toolbar" { {toolbutton -image entityElementsRigidSliding-24.png -command {action entityElementsRigidSliding-24.png}} {toolbutton -image entityElementsRod-24.png -command {action entityElementsRod-24.png}} {toolbutton -image entityElementsSpring-24.png -command {action entityElementsSpring-24.png}} {toolbutton -image entityElementsTetra4-24.png -command {action entityElementsTetra4-24.png}} }

     

    tested on HV 2019:

    image