[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been replaced by ToolItem API

Daniel Morgan danielmorgan at verizon.net
Mon Jun 20 19:01:48 EDT 2005


What is the ToolItem API? 

I get a warning CS0618: 'Gtk.Toolbar.AppendItem(string, string, string, 
Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by ToolItem API'

Here is the warning message I get:
sqlsharpgtk.cs(545) warning CS0618: 'Gtk.Toolbar.AppendItem(string, 
string, string, Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by 
ToolItem API'

monodoc does not answer this online.  I see where it mentions a function 
is deprecated - but it does not mention what replaces it.

Here is the source code I have:

            Toolbar toolbar = new Toolbar ();

            toolbar.ToolbarStyle = Gtk.ToolbarStyle.Icons;

            toolbar.AppendItem ("New SQL Editor",
                "New SQL Editor", String.Empty,
                new Gtk.Image (Stock.New, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_FileNew));   

            toolbar.AppendItem ("Open SQL Editor",
                "Open file into SQL Editor", String.Empty,
                new Gtk.Image (Stock.Open, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_FileOpen));   

            toolbar.AppendItem ("Save SQL Editor",
                "Save file from SQL Editor", String.Empty,
                new Gtk.Image (Stock.Save, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_FileSave));   

            toolbar.AppendItem ("Close SQL Editor",
                "Close SQL Editor", String.Empty,
                new Gtk.Image (Stock.Close, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_FileClose));   

            toolbar.AppendSpace ();

            toolbar.AppendItem ("Execute Command",
                "Execute SQL Command.", String.Empty,
                new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_ExecuteCommand));   

            toolbar.AppendItem ("Execute Script",
                "Execute SQL Script.", String.Empty,
                new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_ExecuteScript));   

            toolbar.AppendItem ("Output",
                "Toggle Results to Grid or Log", String.Empty,
                new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_ToggleResultsOutput));   

            toolbar.AppendItem ("Query Mode",
                "Execute as Query or NonQuery", String.Empty,
                new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
                new Gtk.SignalFunc (OnToolbar_ToggleQueryMode));   
          
            combo = ComboBox.NewText();
            combo.Changed += new EventHandler (OnDataSourceChanged);
            toolbar.AppendWidget (combo, "Connected Data Source to send 
SQL statements to execute", String.Empty);
            combo.AppendText(NotConnected);
            combo.Active = 0;




More information about the Gtk-sharp-list mailing list