How to expand the tab area using code

sebastianedm
sebastianedm Altair Community Member
edited November 2020 in Community Q&A

I am trying to expand the right tab area of hypermesh GUI using code.

Manual step: View >>Tab area>>Right

is there a code that dose the above manual step ??

Best Answer

  • tinh
    tinh Altair Community Member
    edited November 2020 Answer ✓

    Hi,

    I remember that I answered a similar somewhere, but I can't find the post!

    you can invoke the menu:

    in Hypermesh:

    [. cget -menu].view.tab_area invoke "Right"

     

    But if you use Hypermesh Desktop, menu widgets (and others) seem to be dynamically generated!

    so we need to detect them, example proc:

    proc callMainPulldown args { 	set mnuMain [. cget -menu] 	set mnuName $mnuMain 	set found [lrepeat [llength $args] 0] 	set cur 0 	foreach inputText $args { 		set itemCount [$mnuName index end] 		for {set i 0} {$i <= $itemCount} {incr i} { 			if {[string equal "separator" [$mnuName type $i]]} continue 			set mnuText [$mnuName entrycget $i -label] 			if {[string equal -nocase $inputText $mnuText]} { 				lset found $cur 1 				lset args $cur $mnuText 				if {[string equal "cascade" [$mnuName type $i]]} { 					set mnuName [$mnuName entrycget $i -menu] 					break 				} 			} 		} 		incr cur 	} 	set idx [lsearch -exact $found 0] 	if {$idx != -1} {return -code error "Error in callMainPulldown: Not found menu item '[lindex $args $idx]'"} 	$mnuName invoke [lindex $args end] } # usage: callMainPulldown View "Tab Area" Right  # you can call other things: callMainPulldown xyplots create curves "single curve"

     

Answers

  • tinh
    tinh Altair Community Member
    edited November 2020 Answer ✓

    Hi,

    I remember that I answered a similar somewhere, but I can't find the post!

    you can invoke the menu:

    in Hypermesh:

    [. cget -menu].view.tab_area invoke "Right"

     

    But if you use Hypermesh Desktop, menu widgets (and others) seem to be dynamically generated!

    so we need to detect them, example proc:

    proc callMainPulldown args { 	set mnuMain [. cget -menu] 	set mnuName $mnuMain 	set found [lrepeat [llength $args] 0] 	set cur 0 	foreach inputText $args { 		set itemCount [$mnuName index end] 		for {set i 0} {$i <= $itemCount} {incr i} { 			if {[string equal "separator" [$mnuName type $i]]} continue 			set mnuText [$mnuName entrycget $i -label] 			if {[string equal -nocase $inputText $mnuText]} { 				lset found $cur 1 				lset args $cur $mnuText 				if {[string equal "cascade" [$mnuName type $i]]} { 					set mnuName [$mnuName entrycget $i -menu] 					break 				} 			} 		} 		incr cur 	} 	set idx [lsearch -exact $found 0] 	if {$idx != -1} {return -code error "Error in callMainPulldown: Not found menu item '[lindex $args $idx]'"} 	$mnuName invoke [lindex $args end] } # usage: callMainPulldown View "Tab Area" Right  # you can call other things: callMainPulldown xyplots create curves "single curve"

     

  • sebastianedm
    sebastianedm Altair Community Member
    edited November 2020
    tinh said:

    Hi,

    I remember that I answered a similar somewhere, but I can't find the post!

    you can invoke the menu:

    in Hypermesh:

    [. cget -menu].view.tab_area invoke "Right"

     

    But if you use Hypermesh Desktop, menu widgets (and others) seem to be dynamically generated!

    so we need to detect them, example proc:

    proc callMainPulldown args { 	set mnuMain [. cget -menu] 	set mnuName $mnuMain 	set found [lrepeat [llength $args] 0] 	set cur 0 	foreach inputText $args { 		set itemCount [$mnuName index end] 		for {set i 0} {$i <= $itemCount} {incr i} { 			if {[string equal "separator" [$mnuName type $i]]} continue 			set mnuText [$mnuName entrycget $i -label] 			if {[string equal -nocase $inputText $mnuText]} { 				lset found $cur 1 				lset args $cur $mnuText 				if {[string equal "cascade" [$mnuName type $i]]} { 					set mnuName [$mnuName entrycget $i -menu] 					break 				} 			} 		} 		incr cur 	} 	set idx [lsearch -exact $found 0] 	if {$idx != -1} {return -code error "Error in callMainPulldown: Not found menu item '[lindex $args $idx]'"} 	$mnuName invoke [lindex $args end] } # usage: callMainPulldown View "Tab Area" Right  # you can call other things: callMainPulldown xyplots create curves "single curve"

     

    Thanks for the quick help.