Jump to content
  • Announcements

    • Rahul Ponginan

      Please click here for a short but important announcement   03/26/17

      Dear Users Our Commercial and Academic users around the world can use these same forums here as before i.e. the Altair Support Forum , Commercial users from India with solver queries can go to the Solver Forum for India Commercial Users , Academic Users from India and AOC India Participants are requested to go to the Forum for India Academic Users and AOC India Participants , We will be tending to all queries in all the forums promptly as before, thank you for your understanding. 
Suresh Vijayan

How to Create widgets like label frame in HM framework tab

Recommended Posts

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 

 

 

GUI_Issue.PNG.b73029838fc3261b982a1da0d1f17f1f.PNG

 

BUTTON AND RADIO BUTTON AND IS THERE BUT LABEL FRAME IS NOT THERE.HOW TO CREATE THAT LABEL FRAME 

 

Thanks & Regards 

 

Suresh Kumar V

Share this post


Link to post
Share on other sites

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;

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Suresh Vijayan likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×