Re: Parse input file and create widgets
- From: anilby@xxxxxxxxx
- Date: 27 May 2005 07:43:37 -0700
anilby@xxxxxxxxx wrote:
> Donald Arseneau wrote:
> > anilby@xxxxxxxxx writes:
> >
> > > It didn't worked with -command, but it worked with "bind"
> > >
> > > radiobutton .frame#1.labframe.rb$name \
> > > -anchor w \
> > > -value $row1 \
> > > -variable rbutton
> > > }
> > > bind .frame#1.labframe.rb$name <Button-1> {set_rbutton %W}
> >
> > That widget name "frame#1" looks like something generated by a
> > gui-builder program like SpecTcl, whitch itself supports %W in
> > -command. (Not all % tags, but %W for the widhet name.)
> >
> > If you are typing it directly, then just enter the true widget
> > name there, with proper quoting:
> >
> > -command [list set_rbutton .frame#1.labframe.rb$name ]
> >
> > > How can I delete this radio button from some other procedure?
> >
> > Anyway, when you have a set of radiobuttons, it is most convenient
> > to name them according to the value.
> >
> >
> > --
> > Donald Arseneau asnd@xxxxxxxxx
>
> I have created the below UI
>
> ___________________________________________________________________
> OpenFile (<---this is a menubutton)
> ------------------------------------------------------------------
> | |
> | |
> | |
> | One List box here | and one more list box here
> | |
> | |
> -------------------------------------------------------------------
> |<this is a frame>
> |
> |A <edit box with value 00>
> |B <listbox with drop down with values 0 1 2 3>
> |<.. like this there are many widgets.....>
> |
> -------------------------------------------------------------------
>
> The number of widgets in the bottom frame depends on the input file.
> I am able to create all the widgets but the frame is not scrollable.
> I tried the methods posted in comp.lang.tcl to create a scrolled frame.
> But I couldn't get the frmae scrolled. I am pasting the code below:
> (basic UI was created in SpecTCL and later I added some custom code to
> it)
> Please let me know how can I make the frame scrollable
>
> ****************************************
>
> frame $base.frame#1 -bd 1 -relief groove
>
> menubutton $base.menubutton#1 \
> -menu "$base.menubutton#1.m" \
> -borderwidth 2 \
> -justify left \
> -relief groove \
> -text File
>
> menubutton $base.menubutton#2 \
> -menu "$base.menubutton#2.m" \
> -borderwidth 2 \
> -justify left \
> -relief groove \
> -text Edit
>
> message $base.testcases \
> -background white \
> -text Protocol \
> -width 60
>
> message $base.teststatus \
> -background white \
> -text Messages \
> -width 70
>
> listbox $base.listboxprotocols \
> -background white \
> -height 1 \
> -width 1 \
> -selectmode single \
> -yscrollcommand "$base.protocolscroll set"
>
> scrollbar $base.protocolscroll \
> -command "$base.listboxprotocols yview"
>
> listbox $base.listboxmessages \
> -background white \
> -height 1 \
> -width 1 \
> -yscrollcommand "$base.messagesscroll set"
>
> scrollbar $base.messagesscroll \
> -command "$base.listboxmessages yview"
>
> button $base.button#3 \
> -text --> \
> -command show_messages
>
> grid $base.menubutton#1 -in $root -row 1 -column 1
> grid $base.menubutton#2 -in $root -row 1 -column 2
>
> grid $base.frame#1 -in $root -row 13 -column 1 \
> -columnspan 50 \
> -rowspan 78 \
> -sticky nw
>
> grid $base.testcases -in $root -row 2 -column 4
> grid $base.teststatus -in $root -row 2 -column 12
> grid $base.listboxprotocols -in $root -row 3 -column 2 \
> -columnspan 6 \
> -rowspan 7 \
> -sticky nesw
> grid $base.protocolscroll -in $root -row 3 -column 8 \
> -rowspan 7 \
> -sticky ns
> grid $base.listboxmessages -in $root -row 3 -column 10 \
> -columnspan 4 \
> -rowspan 7 \
> -sticky nesw
> grid $base.messagesscroll -in $root -row 3 -column 15 \
> -rowspan 7 \
> -sticky ns
> grid $base.button#3 -in $root -row 6 -column 9
>
> *********************************************************************
>
> Thanks and regards,
> Anil.
I want to provide more inputs for the above query.
after the above peice of code, there is code for:
grid rowconfigure
grid columnconfigure
then there is a proc that reads the input file line by line
and creates widgets accordingly on the below frame.
i.e., the width & height of the bottom frame is dynamic.
So I just need to make this frame scrollable?
.
- References:
- Parse input file and create widgets
- From: anilby
- Re: Parse input file and create widgets
- From: Bryan Schofield
- Re: Parse input file and create widgets
- From: anilby
- Re: Parse input file and create widgets
- From: anilby
- Re: Parse input file and create widgets
- From: Arjen Markus
- Re: Parse input file and create widgets
- From: anilby
- Re: Parse input file and create widgets
- From: Donald Arseneau
- Re: Parse input file and create widgets
- From: anilby
- Parse input file and create widgets
- Prev by Date: Re: switch statement and numeric constants
- Next by Date: Re: Just wanted to express my appreciation
- Previous by thread: Re: Parse input file and create widgets
- Next by thread: Re: Parse input file and create widgets
- Index(es):