mail-archives/gtk-sharp-list/2005-June/006020.html

171 строка
8.1 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=2b11ca900506202338742e0c54%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="006018.html">
<LINK REL="Next" HREF="006021.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
replaced by ToolItem API</H1>
<B>Daniel Morgan</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=2b11ca900506202338742e0c54%40mail.gmail.com"
TITLE="[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
replaced by ToolItem API">danielmorgan at verizon.net
</A><BR>
<I>Tue Jun 21 19:27:53 EDT 2005</I>
<P><UL>
<LI>Previous message: <A HREF="006018.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
replaced by ToolItem API
</A></li>
<LI>Next message: <A HREF="006021.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#6020">[ date ]</a>
<a href="thread.html#6020">[ thread ]</a>
<a href="subject.html#6020">[ subject ]</a>
<a href="author.html#6020">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>I'm using mono 1.1.8/gtk# 1.9.5/gtk+ 2.6 on Windows.
How do you use the UIManager API?
Is there is a Mono/GTK# Guide for Upgrading our apps from a Mono
1.0.x/gtk# 1.0.x/gtk+ 2.2 API to a Mono 1.1.x/gtk# 1.9.x/gtk+ 2.6 API?
What did the developers working on MonoDevelop do?
Jeroen Zwartepoorte wrote:
&gt;<i>Even better is to use the new UIManager API (if you're using Gtk# &gt;
</I>&gt;<i>1.0). See sample/Actions.cs for a concrete example.
</I>&gt;<i>
</I>&gt;<i>Jeroen
</I>&gt;<i>
</I>&gt;<i>On 6/21/05, Mario Carri&#243;n &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">mario.carrion at gmail.com</A>&gt; wrote:
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;&gt;<i>On Mon, 2005-06-20 at 19:01 -0400, Daniel Morgan wrote:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>What is the ToolItem API?
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>I get a warning CS0618: 'Gtk.Toolbar.AppendItem(string, string, string,
</I>&gt;&gt;&gt;<i>Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by ToolItem API'
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>Here is the warning message I get:
</I>&gt;&gt;&gt;<i>sqlsharpgtk.cs(545) warning CS0618: 'Gtk.Toolbar.AppendItem(string,
</I>&gt;&gt;&gt;<i>string, string, Gtk.Widget, Gtk.SignalFunc)' is obsolete: 'Replaced by
</I>&gt;&gt;&gt;<i>ToolItem API'
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>monodoc does not answer this online. I see where it mentions a function
</I>&gt;&gt;&gt;<i>is deprecated - but it does not mention what replaces it.
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>Here is the source code I have:
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Toolbar toolbar = new Toolbar ();
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.ToolbarStyle = Gtk.ToolbarStyle.Icons;
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;New SQL Editor&quot;,
</I>&gt;&gt;&gt;<i> &quot;New SQL Editor&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.New, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_FileNew));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Open SQL Editor&quot;,
</I>&gt;&gt;&gt;<i> &quot;Open file into SQL Editor&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.Open, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_FileOpen));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Save SQL Editor&quot;,
</I>&gt;&gt;&gt;<i> &quot;Save file from SQL Editor&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.Save, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_FileSave));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Close SQL Editor&quot;,
</I>&gt;&gt;&gt;<i> &quot;Close SQL Editor&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.Close, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_FileClose));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendSpace ();
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Execute Command&quot;,
</I>&gt;&gt;&gt;<i> &quot;Execute SQL Command.&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_ExecuteCommand));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Execute Script&quot;,
</I>&gt;&gt;&gt;<i> &quot;Execute SQL Script.&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.Execute, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_ExecuteScript));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Output&quot;,
</I>&gt;&gt;&gt;<i> &quot;Toggle Results to Grid or Log&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_ToggleResultsOutput));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> toolbar.AppendItem (&quot;Query Mode&quot;,
</I>&gt;&gt;&gt;<i> &quot;Execute as Query or NonQuery&quot;, String.Empty,
</I>&gt;&gt;&gt;<i> new Gtk.Image (Stock.GoDown, IconSize.LargeToolbar),
</I>&gt;&gt;&gt;<i> new Gtk.SignalFunc (OnToolbar_ToggleQueryMode));
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> combo = ComboBox.NewText();
</I>&gt;&gt;&gt;<i> combo.Changed += new EventHandler (OnDataSourceChanged);
</I>&gt;&gt;&gt;<i> toolbar.AppendWidget (combo, &quot;Connected Data Source to send
</I>&gt;&gt;&gt;<i>SQL statements to execute&quot;, String.Empty);
</I>&gt;&gt;&gt;<i> combo.AppendText(NotConnected);
</I>&gt;&gt;&gt;<i> combo.Active = 0;
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;<i>Try using:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>Gtk.Tooltips tooltips = new Gtk.Tooltips ();
</I>&gt;&gt;<i>Gtk.ToolButton button = new Gtk.ToolButton (Gtk.Stock.Ok);
</I>&gt;&gt;<i>button.SetTooltip (_tooltips, &quot;My tool button&quot;, &quot;My nice tool button!&quot;);
</I>&gt;&gt;<i>button.Clicked += SomeEventHandler;
</I>&gt;&gt;<i>//This method replaces AppendWidget (and some others)
</I>&gt;&gt;<i>toolbar.Insert (button, -1);
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="006018.html">[Gtk-sharp-list] Toolbar.AppendItem is obsolete and has been
replaced by ToolItem API
</A></li>
<LI>Next message: <A HREF="006021.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#6020">[ date ]</a>
<a href="thread.html#6020">[ thread ]</a>
<a href="subject.html#6020">[ subject ]</a>
<a href="author.html#6020">[ 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>