Komodo: Accessing widgets in the auto generated _ui.tcl from the associated .tcl file
- From: google_monster99@xxxxxxxxx
- Date: 24 Jun 2005 14:20:00 -0700
I am using Komodo.
I created a text widget and want to insert some text into it.
The below is my ui.tcl file (ie. Dialog_ui.tcl). In my Dialog.tcl file
I want to have access to the $base._text_log widget, so I can insert
text into it.
For eg. I've tried:
::Dialog::._text_log insert end "hello world!"
And other variations, but have not succeeded.
This seems to be something trivial, but I can't seem to figure it
out. I also tried to get to the BASE variable, but was also
unsuccessful. I guess my understanding of namespaces isn't correct.
Is it even possible?
Help is very very much appreciated. Thank you!
# Below is the gui code in Dialog_ui.tcl
# Declare the namespace for this dialog
namespace eval Dialog {}
package require Tk
# Dialog::ui --
#
# Create the UI for this dialog.
#
# ARGS:
# root the parent window for this form
# args a catch-all for other args, but none are expected
#
proc Dialog::ui {root args} {
# this handles '.' as a special case
set base [expr {($root == ".") ? "" : $root}]
variable ROOT $root
variable BASE $base
# Widget Initialization
text $base._text_log \
-height 0 \
-width 0 \
-xscrollcommand [namespace code [list _text_log_xscrollcommand]] \
-yscrollcommand [namespace code [list _text_log_yscrollcommand]]
# Geometry Management
grid $base._text_log -in $root -row 1 -column 1 \
-columnspan 1 \
-ipadx 0 \
-ipady 0 \
-padx 0 \
-pady 0 \
-rowspan 1 \
-sticky news
# Resize Behavior
grid rowconfigure $root 1 -weight 0 -minsize 40 -pad 0
grid rowconfigure $root 2 -weight 0 -minsize 40 -pad 0
grid columnconfigure $root 1 -weight 0 -minsize 40 -pad 0
grid columnconfigure $root 2 -weight 0 -minsize 40 -pad 0
}
.
- Prev by Date: Re: tcl and i/o descriptors
- Next by Date: Canvas - vicious cycle with "current" tag - long
- Previous by thread: ActiveTcl Pro: How to create a standalone app which uses Tcl, Tk, Expect, BWidgets, IWidgets
- Next by thread: Canvas - vicious cycle with "current" tag - long
- Index(es):
Relevant Pages
|