[Gtk-sharp-list] How to create a group for Gtk.RadioToolButton
Thu, 14 Apr 2005 13:35:02 +0200
Sorry for misreading your question. I have not played with those yet.
In monodoc I find the followin ctor:
Constructor with support for button groups.
Create a new button in the same group as another.
So you would first create a button with the first ctor, then use that
Button as an argument in all the following buttons.
The SList argument of the first ctor is not a problem since, according
GLib.SList, an existing radio button group, or null
if you are creating a new group.
So just put in null:
button1 = new RadioToolButton(null);
button2 = new RadioToolButton(button1);
I guess you'd put in the label text using the inherited (from ToolItem)
Hope this helps :)
Funny thing, looking in the svn, I can only see a custom file for
RadioButton and for RadioMenuButton... RadioToolButton are apparantly
Thomas Pryds Lauritsen wrote:
> Hi Anset
> Thank you for your reply. I think I might not be saying clearly enough
> what it is that I want, though. I am talking about RadioToolButtons for
> placing in a Gtk.Toolbar, not plain RadioButtons. (RadioToolButton does
> not inherit from RadioButton)
> Anset wrote:
> | There is also a constructor that does not take a button. :)
> According to monodoc, there is not such a constructor for
> RadioToolButton, though.
> | Button0 = new RadioButton("Label0");;
> | Button1 = new RadioButton(group, "label1");
> | Button2 = new RadioButton(group, "label2");
> This doesn't seem to work with RadioToolButton, though. I tried the
> following code:
> Toolbar t = new Tollbar();
> RadioToolButton r0 = new RadioToolButton();
> r0.Label = "label 0";
> RadioToolButton r1 = new RadioToolButton(r0);
> r0.Label = "label 1";
> However, the initialisation of r0 fails since there is no suh
> constructor for RadioToolButton.
Gtk-sharp-list maillist - Gtkfirstname.lastname@example.org