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.


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

> --- /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
>    }
>
>    # ------------------------------------------------------------------
>


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