Posted to tcl by jeremy_c at Mon Sep 17 23:47:12 GMT 2007view raw
- namespace eval note_module {
- set form ""
- set title "Untitled"
- set tags ""
- }
- proc note_module::on_save {} {
- puts "SAVING"
- }
- proc note_module::initialize {} {
- puts "Loading note module..."
- mk::view layout db.note_module "id:I body"
- }
- proc note_module::editor_form {base} {
- ttk::frame $base.note_module
- ttk::label $base.note_module.title_l -text "Title"
- ttk::entry $base.note_module.title -textvariable ::title
- ttk::label $base.note_module.tags_l -text "Tags"
- ttk::entry $base.note_module.tags -textvariable ::tags
- ttk::label $base.note_module.body_l -text "Body"
- text $base.note_module.body
- ttk::frame $base.note_module.commands
- ttk::button $base.note_module.commands.save -text "Save" -command note_module::on_save
- pack $base.note_module.commands.save -side left -padx 1 -pady 0 -expand 1 -fill x -anchor w
- grid $base.note_module.title_l -row 0 -column 0 -pady 1 -padx 3 -sticky w
- grid $base.note_module.title -row 0 -column 1 -pady 1 -padx 3 -sticky we
- grid $base.note_module.tags_l -row 1 -column 0 -pady 1 -padx 3 -sticky w
- grid $base.note_module.tags -row 1 -column 1 -pady 1 -padx 3 -sticky we
- grid $base.note_module.body_l -row 2 -column 0 -pady 1 -padx 3 -sticky nw
- grid $base.note_module.body -row 2 -column 1 -pady 1 -padx 5 -sticky nswe
- grid $base.note_module.commands -row 3 -column 1 -pady 1 -padx 5 -sticky w
- grid rowconfigure $base.note_module 2 -weight 1
- grid columnconfigure $base.note_module 1 -weight 1
- }