This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFA] Add custom type to toolbar.
- To: Keith Seitz <keiths at cygnus dot com>
- Subject: Re: [RFA] Add custom type to toolbar.
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Wed, 10 Oct 2001 09:56:16 -0400
- CC: Ian Roxborough <irox at redhat dot com>, insight at sources dot redhat dot com
- Organization: Red Hat Canada
- References: <Pine.GSO.4.33.0110091627270.26943-100000@makita.cygnus.com>
Keith Seitz wrote:
>
> On Tue, 9 Oct 2001, Ian Roxborough wrote:
>
> > this little patch lets us add any widget to the toolbar.
>
> Fernando might be a better source for this than I, but it looks correct to
> me. Fernando?
>
> Keith
>
I guess this generalizes what was done for label, i.e. a uncontrolled
kind
of object (which raises the question: does the specialized function for
label
still makes sense?).
But this allows one to create a fancy widget and add it to the toolbar.
Otherwise we are limited to known widgets.
Well, I would say that we will have to add it if needed. Ian: do you
have
a specific use for this in mind?
Regards,
Fernando
> > --- /space/work/gdb/sources.redhat.com/src/gdb/gdbtk/library/gdbtoolbar.itcl
> > Thu Feb 1 14:56:27 2001
> > +++ gdbtoolbar.itcl Tue Oct 9 16:03:54 2001
> > @@ -108,6 +108,9 @@
> > separator {
> > toolbar_add_button_separator
> > }
> > + custom {
> > + eval toolbar_add_custom $args
> > + }
> > default {
> > error "Invalid item type: $type"
> > }
> > @@ -139,6 +142,22 @@
> > eval label $lname -text \$text $args
> > balloon register $lname $balloon
> > lappend button_list $lname
> > + }
> > +
> > + # ------------------------------------------------------------------
> > + # PRIVATE METHOD: toolbar_add_custom - Create a user defined widget
> > + # to be inserted in the toolbar.
> > + # ------------------------------------------------------------------
> > +
> > + private method toolbar_add_custom {name createCmd balloon args} {
> > + set wname $ButtonFrame.$name
> > + set Buttons($name) $wname
> > + set Buttons($wname,align) $button_align
> > +
> > + eval $createCmd $wname $args
> > + balloon register $wname $balloon
> > +
> > + lappend button_list $wname
> > }
> >
> > # ------------------------------------------------------------------
> >
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9