This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[RFA] Add custom type to toolbar.
- To: insight at sources dot redhat dot com
- Subject: [RFA] Add custom type to toolbar.
- From: Ian Roxborough <irox at redhat dot com>
- Date: Tue, 09 Oct 2001 16:09:29 -0700
Hi,
this little patch lets us add any widget to the toolbar.
Ian.
--- /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
}
# ------------------------------------------------------------------