This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] Add custom type to toolbar.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]