Tk Source Code

Artifact [b764f062]
Login

Artifact b764f0620fb831f973e360a4df2e17178e2a1fc8e21306d9fb56520eff2584c2:

Attachment "mwdemo.tcl" to ticket [657c3891] added by sbron 2017-12-07 21:49:22. (unpublished)
#!/usr/bin/tclsh

package require Tk 8.6

::tk::Megawidget create mwdemo {} {
    method CreateHull {} {
	my variable w hull
	set hull [toplevel $w]
	place [ttk::frame $w.bg] -relwidth 1 -relheight 1
	bind $w.bg <Destroy> [list [namespace which my] destroy]
    }

    method Create {} {
	my variable w details

	ttk::menubutton $w.b1 -text Menu
	$w.b1 configure -menu [menu $w.b1.menu -tearoff 0]

	$w.b1.menu add radiobutton -label Checkbutton \
	  -variable [namespace which -variable details]

	ttk::button $w.b2 -width 0 -text Crash \
	  -command [list [namespace which my] destroy]

	pack $w.b1 $w.b2 -side top -fill x -padx 2 -pady 2
    }
}

mwdemo .mwdemo