Jump to content
Sign in to follow this  
Girish2121

Add Browser Tabs

Recommended Posts

Hey Tinh and others as well,

Thanks for helping everyone in the field of automation. 
I have query which is extended version of above query

Since, I had already developed a GUI using tab feature. But, due to its use on another machine (with changed screen resolution), the buttons at bottom are hidden. So I decided to add scrollbar. But no success.

 

Earlier My code was this -

    
    catch {hm_framework removetab "Test-Group A"
    destroy .main}
    
    set main [ frame .main ]
    hm_framework addtab "Test-Group A" $main
    hm_framework resizetab "Test-Group A" 440 
    
    
    frame $main.main_frame -height 550 -width 450 -bg "#C5E1A5"
    grid $main.main_frame -row 0 -column 0 -sticky w -padx 0 -pady 0
    
        image create photo imgobj0 -file "$::script_address\JarFiles/Image/Test_Logo_222.png" -width 450 -height 130
        label $main.main_frame.label0 -bg "black"
        grid $main.main_frame.label0 -row 0 -column 0 -sticky w -padx 0 -pady 2 -columnspan 2
        $main.main_frame.label0 configure -image imgobj0

 

... and so on (includes Labels, entries, buttons in vertical layout)

 

After implementing scrollbar and related parent frame, canvas and child frame- 

 

    catch {hm_framework removetab "Test-Group A"
    destroy .main}
    
    set fmain [ frame .main ]
    hm_framework addtab "Test-Group A" $fmain
    hm_framework resizetab "Test-Group A" 440 
    
    #set up scrollable frame

    set frmparent [frame $fmain.frmparent -width 450 -height 500 ]
    set canvas1 [canvas $frmparent.canvas1 -width 553 -height 600 -xscrollcommand "$frmparent.hscroll set" -width 523 -height 500 -yscrollcommand "$frmparent.vscroll set"]
    set main [frame $canvas1.frmscrolled]

    # package require BWidget

    # ScrollableFrame $frmparent

    # set frmscroll [$frmparent getframe]

    set hscroll [scrollbar $frmparent.hscroll -orient h -command "$canvas1 xview"]
    
    set vscroll [scrollbar $frmparent.vscroll -orient v -command "$canvas1 yview"]

    pack $frmparent.hscroll -side bottom -fill x
    pack $frmparent.vscroll -side right -fill y
    pack $canvas1 -expand yes  -side top
    

    $canvas1 create window 0 0 -anchor nw -window $main 

    $canvas1 configure -scrollregion [$canvas1 bbox all]
    
    pack $frmparent -expand yes -fill both -side top
    
    
    frame $main.main_frame -height 550 -width 450 -bg "#C5E1A5"
    grid $main.main_frame -row 0 -column 0 -sticky w -padx 0 -pady 0
    
        image create photo imgobj0 -file "$::script_address\JarFiles/Image/Test_Logo_222.png" -width 450 -height 130
        label $main.main_frame.label0 -bg "black"
        grid $main.main_frame.label0 -row 0 -column 0 -sticky w -padx 0 -pady 2 -columnspan 2
        $main.main_frame.label0 configure -image imgobj0

 

... and so on (includes Labels, entries, buttons in vertical layout)

 

But it seems to not work.

 

Thanks,

 

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.

Sign in to follow this  

×
×
  • Create New...