зеркало из https://github.com/mono/mail-archives.git
171 строка
8.1 KiB
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:
|
|
|
|
><i>Even better is to use the new UIManager API (if you're using Gtk# >
|
|
</I>><i>1.0). See sample/Actions.cs for a concrete example.
|
|
</I>><i>
|
|
</I>><i>Jeroen
|
|
</I>><i>
|
|
</I>><i>On 6/21/05, Mario Carrión <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">mario.carrion at gmail.com</A>> wrote:
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>>><i>On Mon, 2005-06-20 at 19:01 -0400, Daniel Morgan wrote:
|
|
</I>>><i>
|
|
</I>>><i>
|
|
</I>>>><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>>>><i>
|
|
</I>>>><i>
|
|
</I>>><i>Try using:
|
|
</I>>><i>
|
|
</I>>><i>Gtk.Tooltips tooltips = new Gtk.Tooltips ();
|
|
</I>>><i>Gtk.ToolButton button = new Gtk.ToolButton (Gtk.Stock.Ok);
|
|
</I>>><i>button.SetTooltip (_tooltips, "My tool button", "My nice tool button!");
|
|
</I>>><i>button.Clicked += SomeEventHandler;
|
|
</I>>><i>//This method replaces AppendWidget (and some others)
|
|
</I>>><i>toolbar.Insert (button, -1);
|
|
</I>>><i>
|
|
</I>>><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>
|