How to Create widgets like label frame in HM framework tab
Hi ,
I am trying to create a UI in the Tab in HM itself. i inserted some widgets like label frame, radio button , button etc.
- in this label frame not showing , how to create a label frame i tried this code with help of hwtk GUI toolkit.
Kindly help me to solve this issue and guide me how to create a UI in HM _framework
I attached the image and code which i used for your reference
################################################CODE##################################################################
#setting the mainframe
set mainfrm [frame .frm1]
# Adding the Tab
hm_framework addtab 'Queries' $mainfrm
# creating a subframe
set subfrm [frame $mainfrm.frmmain1 ]
pack $subfrm -side top -fill both
# creating lable
#pack [label $subfrm.lb1 -text 'Query Report Generation' -width 60] -side left -fill x -expand 0
# creating label frame for TGW
pack [labelframe $subfrm.lblfrm -text 'TWG_Report'] -pady 4
# #Radio Button in the label frame
pack [radiobutton $subfrm.rdbtn -text 'TWG'] -side top -fill x -pady 2
# creating a screen shot button
pack [button $subfrm.btn -text 'snap shot' -command 'On_Select_SnapShot' ] -side top -fill x -pady 2
# creating a Presentation for TGW
pack [button $subfrm.btn1 -text 'Genrate' -command 'Generate_Report' ] -side top -padx 2 -pady 2
###########################################################################################################
output which i got
BUTTON AND RADIO BUTTON AND IS THERE BUT LABEL FRAME IS NOT THERE.HOW TO CREATE THAT LABEL FRAME
Thanks & Regards
Suresh Kumar V
Answers
-
Hello Suresh,
Try label frame using the below example:
# hwtk::labelframe
hwtk::dialog .dlg
set w [.dlg recess]
# A group of radiobuttons in a labelframe
hwtk::labelframe $w.f -text 'Value';
pack $w.f -side left;
foreach value {1 2 3 4} {
hwtk::radiobutton $w.f.b$value -text 'This is value $value' -variable lfdummy -value $value
pack $w.f.b$value -side top -fill x -pady 2
}
hwtk::labelframe $w.f2
hwtk::checkbutton $w.cb -text 'Use this option.' -variable lfdummy2
$w.f2 configure -labelwidget $w.cb
pack $w.f2 -side left -padx 4 -anchor nw
set t 0
foreach str {Option1 Option2 Option3} {
hwtk::checkbutton $w.f2.b$t -text $str
pack $w.f2.b$t -side top -fill x -pady 2
incr t
}
.dlg post;0 -
Hi livillyle ,
Thanks for reply , but see you creating those widgets in a dialog but i am try to create those widgets in hm framework.see the image which i added i directly adding the widgets in tab which i created in HM UI itself.Kindly help how can i create a label frame in HM framework
Thanks & Regards
Suresh Vijayan
0 -
Hello Suresh,
The below code displays labelframe in hmframework.
set mainfram [frame .mainfram];
hm_framework addtab 'Queries' $mainfram;set frm1 [frame $mainfram.frm1];
pack $frm1 -side top -fill both;set label1 [hwtk::labelframe $frm1.label1 -text 'Value'];
pack $label1 -side left;set rbutton1 [hwtk::radiobutton $label1.rbutton1 -text 'Button1' -variable nil -value 1]
pack $rbutton1 -side top -fill x -pady 2
set rbutton2 [hwtk::radiobutton $label1.rbutton2 -text 'Button2' -variable nil -value 2]
pack $rbutton2 -side top -fill x -pady 2
set rbutton3 [hwtk::radiobutton $label1.rbutton3 -text 'Button3' -variable nil -value 3]
pack $rbutton3 -side top -fill x -pady 2
set rbutton4 [hwtk::radiobutton $label1.rbutton4 -text 'Button4' -variable nil -value 4]
pack $rbutton4 -side top -fill x -pady 2
Regards,
LL
0 -
Thanks a lot livillyle ,
Its Working fine
Regards
Suresh V
0