Hm_panel Edit using TCL

bharath_pampana
bharath_pampana New Altair Community Member
edited October 2020 in Community Q&A

Hi ,

 

Is there a way to edit panels created using *createmarkpanel?

 

we get a panel by using the command ' *createmarkpanel nodes 1'. We have only proceed option in that panel.
Is there any way i can edit the panel and create 2 buttons called 'Reject' and 'Return'

 

Thanks,

Bharath

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • tinh
    tinh Altair Community Member
    edited September 2019

    I have a way, not official because hooking to panels is tough (it is not tk widget, it is C++).

    Create a tk button looks like 'reject' button, bind it with a script that clear mark then call hm_exitpanel

    Place it over panel area just after *createmarkpanel (need to call via hm_setpanelproc)

    Moreover, you need to raise it again whenever panel is redrawn (if you click 'nodes' to popup advsel menu)

     

    I will give an sample later.

  • tinh
    tinh Altair Community Member
    edited September 2019

    In below sample proc. I use input panel title to realize main panel that 'return' button is placed on

    I test with HM2017. Please test it on HM Desktop also

     

    <?xml version="1.0" encoding="UTF-8"?>Capture.thumb.PNG.2fe4f0800a04d730d054eaf73f0e8cbf.PNG

     

     proc ::*createmarkpanel2 args { set proc [dict get [info frame [info frame]] proc] if {[string equal '{}' $args]} { set InputPanelTitle [lindex [set $proc] end] set CurrentPanelTitle [[if {[info exists ::hw::p_message_label]} {set ::hw::p_message_label} else {set ::HM_Framework::p_message_label}] cget -text] if {[string equal $CurrentPanelTitle $InputPanelTitle]} { lassign [hm_getpanelarea] PNx PNy PNw PNh place .panel_return \ -x [expr $PNx+$PNw-[.panel_return cget -width]-20] \ -y [expr $PNy+$PNh-[.panel_return cget -height]-20-[lindex [hm_getgraphicsarea] 1]] raise .panel_return } else { lower .panel_return } return } else { catch {lower .panel_return} } if {[hm_info functionlock]} return if {![winfo exists .panel_return]} { button .panel_return \ -activebackground #c06060 \ -background #c06060 \ -compound left \ -font {{MS Sans Serif} 10 normal roman} \ -foreground Black \ -height 20 \ -highlightthickness 0 \ -image [image create photo imgBlank] \ -padx 0 -pady 0 \ -text return \ -width 100 } .panel_return configure -command '*clearmark $args; hm_exitpanel' set $proc $args hm_framework registerproc $proc after_menudraw set ERCODE [catch {eval *createmarkpanel $args} RESULT INFO] hm_framework unregisterproc $proc after_menudraw return -code $ERCODE -options $INFO $RESULT }

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2019

    Hello tinh

    sorry for my disturb i need some help with 1 code tcl eggdrop

    if u have the desire and the time to help me with this , thx in advance

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.