Jump to content

Recommended Posts

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"




Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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




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
	} 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


Livil Lyle likes this

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.

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.

  • Create New...