[Gtk-sharp-list] Gtk.Toolbar.InsertStock() : Help Needed

Fredrik Nilsson jymdman@home.se
Fri, 23 Jul 2004 03:43:37 +0200


On tor, 2004-07-22 at 23:14 +0100, wrote:
> Hi,
>     I'm trying to figure out what the "new" method is that replaces
> Gtk.Toolbar.InsertStock() since this has been deprecated.  Unlike
> ImageMenuItem() which has an additional constructor that specifically
> mentions stock items, I seem to be having trouble locating the equivalent
> for Gtk.Toolbar. Please can anyone point me in the right direction ?
> 
> Setup :
> Fedora Core 2
> Mono 1.0 / GTK# / MonoDevelop (From the Ximian yum repository)
> 
> Many Thanks In Advance
> 
> Matt

Hi Matt,

I may be wrong here, but I think the InsertStock method is ok to use for
gtk# 1.0 (gtk 2.2), and InsertStock will be deprecated for gtk# 2.0 (gtk
2.4).
Why are you asking? Doesn't the method work as expected, or what?
I haven't tried to use InsertStock myself, instead I do it another way:

	button = new Button (Stock.Open);
	button.Relief = ReliefStyle.None;
	toolbar.AppendWidget (button, "Open", "Open");

You could also use PrependWidget and InsertWidget.

/Fredrik