Jump to content

Recommended Posts

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 4

set 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 }

Share this post


Link to post
Share on other sites

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?

 

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...