зеркало из https://github.com/mono/mail-archives.git
153 строки
7.0 KiB
HTML
153 строки
7.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Toolbar.AppendItem%20is%20obsolete%20and%20has%20been%0A%09replaced%20by%20ToolItem%20API&In-Reply-To=42B74ADC.80807%40verizon.net">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="006016.html">
|
|
<LINK REL="Next" HREF="006018.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API</H1>
|
|
<B>Mario Carrión</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Toolbar.AppendItem%20is%20obsolete%20and%20has%20been%0A%09replaced%20by%20ToolItem%20API&In-Reply-To=42B74ADC.80807%40verizon.net"
|
|
TITLE="[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API">mario.carrion at gmail.com
|
|
</A><BR>
|
|
<I>Mon Jun 20 20:12:18 EDT 2005</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="006016.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API
|
|
</A></li>
|
|
<LI>Next message: <A HREF="006018.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#6017">[ date ]</a>
|
|
<a href="thread.html#6017">[ thread ]</a>
|
|
<a href="subject.html#6017">[ subject ]</a>
|
|
<a href="author.html#6017">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>On Mon, 2005-06-20 at 19:01 -0400, Daniel Morgan wrote:
|
|
><i> What is the ToolItem API?
|
|
</I>><i>
|
|
</I>><i> I get a warning CS0618: 'Gtk.Toolbar.AppendItem(string, string, string,
|
|
</I>><i> Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by ToolItem API'
|
|
</I>><i>
|
|
</I>><i> Here is the warning message I get:
|
|
</I>><i> sqlsharpgtk.cs(545) warning CS0618: 'Gtk.Toolbar.AppendItem(string,
|
|
</I>><i> string, string, Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by
|
|
</I>><i> ToolItem API'
|
|
</I>><i>
|
|
</I>><i> monodoc does not answer this online. I see where it mentions a function
|
|
</I>><i> is deprecated - but it does not mention what replaces it.
|
|
</I>><i>
|
|
</I>><i> Here is the source code I have:
|
|
</I>><i>
|
|
</I>><i> Toolbar toolbar = new Toolbar ();
|
|
</I>><i>
|
|
</I>><i> toolbar.ToolbarStyle = Gtk.ToolbarStyle.Icons;
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("New SQL Editor",
|
|
</I>><i> "New SQL Editor", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.New, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_FileNew));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Open SQL Editor",
|
|
</I>><i> "Open file into SQL Editor", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.Open, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_FileOpen));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Save SQL Editor",
|
|
</I>><i> "Save file from SQL Editor", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.Save, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_FileSave));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Close SQL Editor",
|
|
</I>><i> "Close SQL Editor", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.Close, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_FileClose));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendSpace ();
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Execute Command",
|
|
</I>><i> "Execute SQL Command.", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_ExecuteCommand));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Execute Script",
|
|
</I>><i> "Execute SQL Script.", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_ExecuteScript));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Output",
|
|
</I>><i> "Toggle Results to Grid or Log", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_ToggleResultsOutput));
|
|
</I>><i>
|
|
</I>><i> toolbar.AppendItem ("Query Mode",
|
|
</I>><i> "Execute as Query or NonQuery", String.Empty,
|
|
</I>><i> new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
|
|
</I>><i> new Gtk.SignalFunc (OnToolbar_ToggleQueryMode));
|
|
</I>><i>
|
|
</I>><i> combo = ComboBox.NewText();
|
|
</I>><i> combo.Changed += new EventHandler (OnDataSourceChanged);
|
|
</I>><i> toolbar.AppendWidget (combo, "Connected Data Source to send
|
|
</I>><i> SQL statements to execute", String.Empty);
|
|
</I>><i> combo.AppendText(NotConnected);
|
|
</I>><i> combo.Active = 0;
|
|
</I>Try using:
|
|
|
|
Gtk.Tooltips tooltips = new Gtk.Tooltips ();
|
|
Gtk.ToolButton button = new Gtk.ToolButton (Gtk.Stock.Ok);
|
|
button.SetTooltip (_tooltips, "My tool button", "My nice tool button!");
|
|
button.Clicked += SomeEventHandler;
|
|
//This method replaces AppendWidget (and some others)
|
|
toolbar.Insert (button, -1);
|
|
|
|
--
|
|
Cheers
|
|
---------
|
|
Mario Carrión <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">mario.carrion at gmail.com</A>>
|
|
<A HREF="http://www.monouml.org">http://www.monouml.org</A>
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="006016.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API
|
|
</A></li>
|
|
<LI>Next message: <A HREF="006018.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
|
|
replaced by ToolItem API
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#6017">[ date ]</a>
|
|
<a href="thread.html#6017">[ thread ]</a>
|
|
<a href="subject.html#6017">[ subject ]</a>
|
|
<a href="author.html#6017">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
|
|
mailing list</a><br>
|
|
</body></html>
|