Hypermesh - Scripting- Tick box
Answers
-
there is a toolkit called HWTK in HW installation.
They might help you to get started.
0 -
Awesome, many thanks Adriano
0 -
just as a hint that i've received from a colleague:
Most of the examples start from a 'preview' frame, in HWTK gallery, which is not available in a regular HM session.
So in order to use some widget, always create first a window/dialog, then start adding your buttons, checks, ...
In the example, 'recess' is the name of the frame/dialog
.
hwtk::dialog .d -title Dialog -transient [winfo toplevel $w]
.d hide apply
.d post
set recess [.d recess]after that, add your other statments.
set w [hwtk::labelframe $recess.lf -text 'Saftey Check' -padding 2]
pack $w -anchor nw -pady 4 -padx 4set i 0
foreach option {'Wipers OK' 'Lights OK' 'Brakes OK' 'Driver Sober'} {
set cb [hwtk::checkbutton $w.b$i -text $option]
pack $cb -side top -fill x -pady 2 -padx 4
incr i }0 -
Many thanks Adriano,
Am typically used to creating windows using
destroy .selection
set f .selection;
frame $f
hm_framework addpanel $f 'Tool Selection';
hm_framework drawpanel $f;Although I will give your version a go.
Something which does bother me is the padding
'pack $cb -side top -fill x -pady 2 -padx 4'
Say I have 20 options and I use this code, a column of 6 tickboxes will appear in the window and the rest will simply not appear What I would like it to do is create columns. How do I get it to create several columns?
0 -
Put the frame in a text box (hwtk text has scrollbars)
And then get hull of textbox, use this hull as a frame to be added to hm panel
0