This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFA] fix tab size spinner
- To: "Martin M. Hunt" <hunt at redhat dot com>
- Subject: Re: [RFA] fix tab size spinner
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Thu, 11 Oct 2001 12:21:23 -0700 (PDT)
- cc: Insight Maling List <insight at sources dot redhat dot com>
On Thu, 11 Oct 2001, Martin M. Hunt wrote:
> More brain-damaged iwidgets. The tab size spinner does not initialize itself
> to the textvariable, instead it initializes the textvariable.
> frame $f.x
> +
> # Tab size
> + set tab_size [pref get gdb/src/tab_size]
> itk_component add size {
> iwidgets::spinint $f.x.size -labeltext "Tab Size" -range {1 16} \
> -step 1 -fixed 2 -width 2 -textvariable [pref varname
> gdb/src/tab_size] \
> -wrap 0
> }
> + $f.x.size delete 0 end
> + $f.x.size insert end $tab_size
Ugh, now I remember why I disliked the preference dialogs... We should not
be using "pref varname gdb/src/tab_size" in the spinint. If we do, then
the instant the spinint is changed, it is saved in the preference, no?
Sounds a little backwards.
We should be doing something like:
iwidgets::spinint ... -textvariable [scope _tab_size] ...
set _tab_size [pref get gdb/src/tab_size]
Then in GlobalPref::_apply, we should be doing
pref set gdb/src/tab_size $_tab_size
Does this not make more sense? Of course, I could be hallucinating. :-)
Keith