mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-08 07:53:17 +02:00
fix the examples in Gtk.*
some other miscellaneous stuff svn path=/trunk/gtk-sharp/; revision=29954
This commit is contained in:
parent
bccf57ab07
commit
7e906fec7c
@ -1,3 +1,9 @@
|
||||
2004-06-19 John Luke <jluke@cfl.rr.com>
|
||||
|
||||
* en/Gtk/*.xml: fix examples so they compile, are children of
|
||||
<remarks /> so they are editable and spaced right, and some
|
||||
miscellaneous fixes and updates
|
||||
|
||||
2004-06-17 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* en/Gtk/Window.xml : document remaining TBAs.
|
||||
|
@ -10,7 +10,8 @@
|
||||
</AssemblyInfo>
|
||||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Functions for drawing points, lines, arcs, and text.
|
||||
</summary>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
@ -129,12 +130,12 @@
|
||||
<Parameter Name="layout" Type="Pango.Layout" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Render a <see cref="T:Pango.Layout" /> onto a <see cref="T:Gdk.Drawable" /></summary>
|
||||
<param name="gc">To be added: an object of type 'Gdk.GC'</param>
|
||||
<param name="x">To be added: an object of type 'int'</param>
|
||||
<param name="y">To be added: an object of type 'int'</param>
|
||||
<param name="layout">To be added: an object of type 'Pango.Layout'</param>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>If you are using Gtk, the usual way to obtain a <see cref="T:Pango.Layout" /> is <see cref="M:Gtk.Widget.CreatePangoLayout()" />.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetSize">
|
||||
@ -264,7 +265,7 @@
|
||||
<Parameter Name="height" Type="System.Int32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Draws a <see cref="T:Gdk.Image" /> onto a drawable.</summary>
|
||||
<param name="gc">To be added: an object of type 'Gdk.GC'</param>
|
||||
<param name="image">To be added: an object of type 'Gdk.Image'</param>
|
||||
<param name="xsrc">To be added: an object of type 'int'</param>
|
||||
@ -273,7 +274,7 @@
|
||||
<param name="ydest">To be added: an object of type 'int'</param>
|
||||
<param name="width">To be added: an object of type 'int'</param>
|
||||
<param name="height">To be added: an object of type 'int'</param>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>The depth of the <see cref="T:Gdk.Image" /> must match the depth of the <see cref="T:Gdk.Drawable" />.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="DrawPoint">
|
||||
@ -458,11 +459,11 @@
|
||||
<Parameter Name="area" Type="Gdk.Rectangle" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of the <see cref="T:Gdk.GC" />.</summary>
|
||||
<param name="gc">a <see cref="T:Gdk.GC" /></param>
|
||||
<param name="filled">a <see cref="T:System.Boolean" /></param>
|
||||
<param name="area">a <see cref="T:Gdk.Rectangle" /></param>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined. Calling Gdk.DrawRectangle (window, gc, TRUE, 0, 0, 20, 20) results in a filled rectangle 20 pixels wide and 20 pixels high. Calling Gdk.DrawRectangle (window, gc, FALSE, 0, 0, 20, 20) results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="DrawLine">
|
||||
@ -567,14 +568,14 @@
|
||||
<Parameter Name="height" Type="System.Int32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of the <see cref="T:Gdk.GC" />.</summary>
|
||||
<param name="gc">a <see cref="T:Gdk.GC" /></param>
|
||||
<param name="filled">a <see cref="T:System.Boolean" /></param>
|
||||
<param name="x">a <see cref="T:System.Int32" /></param>
|
||||
<param name="y">a <see cref="T:System.Int32" /></param>
|
||||
<param name="width">a <see cref="T:System.Int32" /></param>
|
||||
<param name="height">a <see cref="T:System.Int32" /></param>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined. Calling Gdk.DrawRectangle (window, gc, TRUE, 0, 0, 20, 20) results in a filled rectangle 20 pixels wide and 20 pixels high. Calling Gdk.DrawRectangle (window, gc, FALSE, 0, 0, 20, 20) results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GType">
|
||||
@ -610,7 +611,7 @@
|
||||
<ReturnValue />
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>This is a constructor used by derivative types of Drawable. This is not typically used by C# code.</summary>
|
||||
<returns>a <see cref="T:Gdk.Drawable" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
|
@ -27,8 +27,7 @@
|
||||
For the widget to be useful, it should participate in size
|
||||
negotiation and size allocation using the events <see cref="E:Gtk.Widget.SizeAllocated" /> and <see cref="E:Gtk.Widget.SizeRequested" />.</para>
|
||||
<para>
|
||||
Since Gtk.Bin is an abstract class in C, it is necessary to
|
||||
register a Type. Sample follows.
|
||||
Sample follows.
|
||||
</para>
|
||||
<example>
|
||||
<code lang="C#">
|
||||
@ -40,19 +39,9 @@ using Gtk;
|
||||
//
|
||||
class MyPadder : Bin {
|
||||
int pad = 50;
|
||||
static GLib.Type type;
|
||||
Widget child;
|
||||
|
||||
static MyPadder ()
|
||||
{
|
||||
//
|
||||
// Register the type on the static constructor, so it is
|
||||
// available on the instance constructors
|
||||
//
|
||||
type = RegisterGType (typeof (MyPadder));
|
||||
}
|
||||
|
||||
public MyPadder () : base (type)
|
||||
public MyPadder ()
|
||||
{
|
||||
// To track our child widget.
|
||||
Added += new AddedHandler (MyAdded);
|
||||
@ -68,8 +57,8 @@ class MyPadder : Bin {
|
||||
void OnSizeRequested (object o, SizeRequestedArgs args)
|
||||
{
|
||||
if (child != null){
|
||||
int width = args.Requisition.width;
|
||||
int height = args.Requisition.height;
|
||||
int width = args.Requisition.Width;
|
||||
int height = args.Requisition.Height;
|
||||
|
||||
child.GetSizeRequest (out width, out height);
|
||||
if (width == -1 || height == -1)
|
||||
@ -88,10 +77,10 @@ class MyPadder : Bin {
|
||||
Gdk.Rectangle mine = args.Allocation;
|
||||
Gdk.Rectangle his = mine;
|
||||
|
||||
his.x += pad;
|
||||
his.y += pad;
|
||||
his.width -= pad * 2;
|
||||
his.height -= pad * 2;
|
||||
his.X += pad;
|
||||
his.Y += pad;
|
||||
his.Width -= pad * 2;
|
||||
his.Height -= pad * 2;
|
||||
child.SizeAllocate (his);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ButtonApp {
|
||||
{
|
||||
Application.Init ();
|
||||
Window win = new Window ("Button Tester");
|
||||
win.DefaultSize = new Size (200, 150);
|
||||
win.SetDefaultSize (200, 150);
|
||||
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
|
||||
Button btn = new Button ("Click Me");
|
||||
btn.Clicked += new EventHandler (btn_click);
|
||||
|
@ -14,40 +14,34 @@
|
||||
<remarks>
|
||||
<para>
|
||||
A <see cref="T:Gtk.CheckButton" /> places a discrete <see cref="T:Gtk.ToggleButton" /> next to a widget, usually a <see cref="T:Gtk.Label" />. See <see cref="T:Gtk.ToggleButton" /> for more information about toggle/check buttons.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
</para>
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
class CheckButtonSample
|
||||
{
|
||||
CheckButton cb;
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
new CheckButtonSample ();
|
||||
new CheckButtonSample ();
|
||||
}
|
||||
|
||||
|
||||
CheckButtonSample ()
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
Window win = new Window ("CheckButtonSample");
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
VBox vbox = new VBox (true, 1);
|
||||
win.Add (vbox);
|
||||
|
||||
cb = new CheckButton ("Checked");
|
||||
cb.Toggled += new EventHandler (OnCheckToggled);
|
||||
vbox.Add (cb);
|
||||
|
||||
vbox.Add (cb);
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
|
||||
void OnCheckToggled (object obj, EventArgs args)
|
||||
{
|
||||
if (cb.Label == "Checked")
|
||||
@ -59,14 +53,15 @@ class CheckButtonSample
|
||||
cb.Label = "Checked";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OnWinDelete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.ToggleButton</BaseTypeName>
|
||||
|
@ -35,9 +35,7 @@
|
||||
</para>
|
||||
<code lang="c#">
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Gtk;
|
||||
using GLib;
|
||||
|
||||
class ComboSample
|
||||
{
|
||||
@ -55,15 +53,10 @@ class ComboSample
|
||||
Window win = new Window ("ComboSample");
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
GLib.List l = new GLib.List (IntPtr.Zero, typeof (string));
|
||||
|
||||
for (int i =0; i < 5; i++)
|
||||
{
|
||||
l.Append ("String " + i);
|
||||
}
|
||||
string[] list = new string[] {"one", "two", "three"};
|
||||
|
||||
combo = new Combo ();
|
||||
combo.PopdownStrings = l;
|
||||
combo.PopdownStrings = list;
|
||||
combo.DisableActivate ();
|
||||
combo.Entry.Activated += new EventHandler (OnEntryActivated);
|
||||
|
||||
@ -84,9 +77,6 @@ class ComboSample
|
||||
}
|
||||
}
|
||||
</code>
|
||||
<para>
|
||||
See <see cref="T:GLib.List" /> for more about GLib.List.
|
||||
</para>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
|
@ -55,7 +55,7 @@ namespace GtkDialogSample
|
||||
dialog = new Dialog
|
||||
("Sample", win, Gtk.DialogFlags.DestroyWithParent);
|
||||
dialog.Modal = true;
|
||||
dialog.AddButton ("Close", 5);
|
||||
dialog.AddButton ("Close", ResponseType.Close);
|
||||
dialog.Response += new ResponseHandler (on_dialog_response);
|
||||
dialog.Run ();
|
||||
dialog.Destroy ();
|
||||
|
@ -13,7 +13,7 @@
|
||||
<summary>Methods for controlling drag and drop handling.</summary>
|
||||
<remarks>
|
||||
<para>
|
||||
GTK# has a rich set of methods for doing inter-process communication via the drag-and-drop metaphor. GTK# can do drag-and-drop (DND) via multiple protocols. The currently supported protocols are the Xdnd and Motif protocols. As well as the methods listed here, applications may need to use some facilities provided for <see cref="T:Gtk.Selection" />. Also, the Drag and Drop API makes use of events in the <see cref="T:Gtk.Widget" /> class.
|
||||
Gtk# has a rich set of methods for doing inter-process communication via the drag-and-drop metaphor. Gtk# can do drag-and-drop (DND) via multiple protocols. The currently supported protocols are the Xdnd and Motif protocols. As well as the methods listed here, applications may need to use some facilities provided for <see cref="T:Gtk.Selection" />. Also, the Drag and Drop API makes use of events in the <see cref="T:Gtk.Widget" /> class.
|
||||
</para>
|
||||
</remarks>
|
||||
</Docs>
|
||||
|
@ -16,68 +16,62 @@
|
||||
<para>
|
||||
See also the <see cref="T:Gtk.TextView" /> widget for displaying and editing large amounts of text.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
class EntrySample
|
||||
{
|
||||
Entry entry;
|
||||
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
new EntrySample ();
|
||||
new EntrySample ();
|
||||
}
|
||||
|
||||
|
||||
EntrySample ()
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
Window win = new Window ("EntrySample");
|
||||
win.SetDefaultSize (200, 150);
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
VBox vbox = new VBox (false, 1);
|
||||
win.Add (vbox);
|
||||
|
||||
entry = new Entry ("hello world");
|
||||
entry.Editable = true;
|
||||
entry.Visibility = true;
|
||||
vbox.Add (entry);
|
||||
|
||||
CheckButton editable = new CheckButton ("Editable");
|
||||
editable.Toggled += new EventHandler (OnEditableToggled);
|
||||
editable.Active = true;
|
||||
vbox.Add (editable);
|
||||
|
||||
CheckButton visibility = new CheckButton ("Visibility");
|
||||
visibility.Toggled += new EventHandler (OnVisibilityToggled);
|
||||
visibility.Active = true;
|
||||
vbox.Add (visibility);
|
||||
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
|
||||
void OnEditableToggled (object obj, EventArgs args)
|
||||
{
|
||||
entry.Editable = !entry.Editable;
|
||||
}
|
||||
|
||||
|
||||
void OnVisibilityToggled (object obj, EventArgs args)
|
||||
{
|
||||
entry.Visibility = !entry.Visibility;
|
||||
}
|
||||
|
||||
|
||||
void OnWinDelete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.Widget</BaseTypeName>
|
||||
|
@ -22,43 +22,37 @@
|
||||
<para>
|
||||
The functionality of the <see cref="T:Gtk.FileSelection" /> can be extended by using the available accessors to the buttons and drop downs.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
class FileSelectionSample
|
||||
{
|
||||
Label lbl;
|
||||
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
new FileSelectionSample ();
|
||||
new FileSelectionSample ();
|
||||
}
|
||||
|
||||
|
||||
FileSelectionSample ()
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
Window win = new Window ("FileSelectionSample");
|
||||
win.SetDefaultSize (250,200);
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
VBox vbox = new VBox (true, 1);
|
||||
win.Add (vbox);
|
||||
|
||||
Button btn = new Button ("Select a file.");
|
||||
btn.Clicked += new EventHandler (OnButtonClicked);
|
||||
vbox.Add (btn);
|
||||
|
||||
lbl = new Label ("Selected: ");
|
||||
vbox.Add (lbl);
|
||||
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
|
||||
void OnButtonClicked (object o, EventArgs args)
|
||||
{
|
||||
FileSelection fs = new FileSelection ("Choose a file");
|
||||
@ -66,14 +60,15 @@ class FileSelectionSample
|
||||
lbl.Text = "Selected: " + fs.SelectionEntry.Text;
|
||||
fs.Hide ();
|
||||
}
|
||||
|
||||
|
||||
void OnWinDelete (object o, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.Dialog</BaseTypeName>
|
||||
|
@ -21,7 +21,7 @@
|
||||
</summary>
|
||||
<remarks>
|
||||
<para>
|
||||
A GtkIconSource contains a <see cref="T:Gdk.Pixbuf" /> (or image
|
||||
A <see cref="T:Gtk.IconSource" /> contains a <see cref="T:Gdk.Pixbuf" /> (or image
|
||||
filename) that serves as the base image for one or more of the
|
||||
icons in a <see cref="T:Gtk.IconSet" />, along with a
|
||||
specification for which icons in the icon set will be based on
|
||||
|
@ -18,39 +18,38 @@
|
||||
<para>
|
||||
It is commonly dropped down by activating a <see cref="T:Gtk.MenuItem" /> in a <see cref="T:Gtk.MenuBar" /> or in another <see cref="T:Gtk.Menu" />, it can also be popped up by activating a <see cref="T:Gtk.OptionMenu" />. Other composite widgets such as the <see cref="T:Gtk.Notebook" /> can pop up a <see cref="T:Gtk.Menu" /> as well.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
public class MenuApp {
|
||||
|
||||
public class MenuApp
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
Application.Init();
|
||||
|
||||
Window win = new Window ("Menu Sample App");
|
||||
win.DeleteEvent += new DeleteEventHandler (delete_cb);
|
||||
win.SetDefaultSize (200, 150);
|
||||
|
||||
VBox box = new VBox (false, 2);
|
||||
|
||||
MenuBar mb = new MenuBar ();
|
||||
Menu file_menu = new Menu ();
|
||||
MenuItem exit_item = new MenuItem("Exit");
|
||||
exit_item.Activated += new EventHandler (exit_cb);
|
||||
file_menu.Append (exit_item);
|
||||
|
||||
MenuItem file_item = new MenuItem("File");
|
||||
file_item.Submenu = file_menu;
|
||||
mb.Append (file_item);
|
||||
box.PackStart(mb, false, false, 0);
|
||||
|
||||
box.PackStart(mb, false, false, 0);
|
||||
Button btn = new Button ("Yep, that's a menu");
|
||||
box.PackStart(btn, true, true, 0);
|
||||
|
||||
|
||||
win.Add (box);
|
||||
win.ShowAll ();
|
||||
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
@ -63,9 +62,10 @@ public class MenuApp {
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.MenuShell</BaseTypeName>
|
||||
|
@ -32,9 +32,8 @@
|
||||
switch between different groups of information to reduce
|
||||
any flicker caused by widget relayout by the application.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
@ -42,13 +41,12 @@ class NotebookSample
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
new NotebookSample ();
|
||||
new NotebookSample ();
|
||||
}
|
||||
|
||||
|
||||
NotebookSample ()
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
Window win = new Window ("NotebookSample");
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
win.SetDefaultSize (400, 400);
|
||||
@ -59,19 +57,20 @@ class NotebookSample
|
||||
string label = String.Format ("Page {0}", i+1);
|
||||
nb.AppendPage (new Button (label), new Label (label));
|
||||
}
|
||||
|
||||
|
||||
win.Add (nb);
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
|
||||
void OnWinDelete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.Container</BaseTypeName>
|
||||
|
@ -18,9 +18,8 @@
|
||||
<para>Status bars in Gtk maintain a stack of messages. The message at the top of the each bar's stack is the one that will currently be displayed.</para>
|
||||
<para>Any messages added to a statusbar's stack must specify a <paramref name="context_id" /> that is used to uniquely identify the source of a message. This <paramref name="context_id" /> can be generated with <see cref="M:Gtk.Statusbar.GetContextId" />, given a message. Note that messages are stored in a stack, and when choosing which message to display, the stack structure is adhered to, regardless of the context identifier of a message.</para>
|
||||
<para>Messages are added to the bar's stack with <see cref="M:Gtk.Statusbar.Push" />, and the message at the top of the stack can be removed using <see cref="M:Gtk.Statusbar.Pop" />. A message can be removed from anywhere in the stack if it's <paramref name="message_id" /> was recorded at the time it was added. This is done using <see cref="M:Gtk.Statusbar.Remove" />.</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
@ -29,38 +28,36 @@ class StatusbarSample
|
||||
Statusbar sb;
|
||||
const int id = 1;
|
||||
int count;
|
||||
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
new StatusbarSample ();
|
||||
new StatusbarSample ();
|
||||
}
|
||||
|
||||
|
||||
StatusbarSample ()
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
count = 0;
|
||||
|
||||
Window win = new Window ("StatusbarSample");
|
||||
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
win.SetDefaultSize (150, 100);
|
||||
|
||||
|
||||
VBox vbox = new VBox (false, 1);
|
||||
win.Add (vbox);
|
||||
|
||||
|
||||
Button btn = new Button ("Add to counter");
|
||||
btn.Clicked += new EventHandler (OnButtonClicked);
|
||||
vbox.Add (btn);
|
||||
|
||||
|
||||
sb = new Statusbar ();
|
||||
sb.Push (id, "Welcome!");
|
||||
sb.HasResizeGrip = false;
|
||||
vbox.Add (sb);
|
||||
|
||||
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
|
||||
void OnButtonClicked (object obj, EventArgs args)
|
||||
{
|
||||
count ++;
|
||||
@ -68,14 +65,15 @@ class StatusbarSample
|
||||
sb.Pop (id);
|
||||
sb.Push (id, message);
|
||||
}
|
||||
|
||||
|
||||
void OnWinDelete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.HBox</BaseTypeName>
|
||||
|
@ -19,6 +19,9 @@
|
||||
using Gtk;
|
||||
|
||||
class Demo {
|
||||
|
||||
static ThreadNotify notify;
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
Application.Init ();
|
||||
@ -36,6 +39,11 @@ class Demo {
|
||||
LargeComputation ();
|
||||
notify.WakeupMain ();
|
||||
}
|
||||
|
||||
static void LargeComputation ()
|
||||
{
|
||||
// lots of processing here
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
|
@ -17,26 +17,56 @@
|
||||
<para>The appearance of the Viewport can be adjusted using the <see cref="P:Gtk.Viewport.ShadowType" /> property.</para>
|
||||
<para>The following example creates a <see cref="T:Gtk.Table" /> in a Viewport. When placed in a small <see cref="T:Gtk.Window" />, the widgets can be scrolled.
|
||||
|
||||
</para>
|
||||
<example>
|
||||
<code lang="C#">
|
||||
public ScrolledWindow CreateViewport()
|
||||
{
|
||||
ScrolledWindow scroller = new ScrolledWindow();
|
||||
Viewport viewer = new Viewport();
|
||||
|
||||
// Create a table with text entries in it
|
||||
Table widgets = new Table(1, 2, false);
|
||||
widgets.Attach(new Entry("This is example Entry 1"), 0, 1, 0, 1);
|
||||
widgets.Attach(new Entry("This is example Entry 2"), 1, 2, 0, 1);
|
||||
|
||||
// Place the widgets in a Viewport, and the Viewport in a ScrolledWindow
|
||||
viewer.Add(widgets);
|
||||
scroller.Add(viewer);
|
||||
return scroller;
|
||||
<code lang="C#">
|
||||
namespace GtkSamples {
|
||||
|
||||
using Gtk;
|
||||
using System;
|
||||
|
||||
public class ViewportApp {
|
||||
|
||||
public static ScrolledWindow CreateViewport()
|
||||
{
|
||||
ScrolledWindow scroller = new ScrolledWindow();
|
||||
Viewport viewer = new Viewport();
|
||||
|
||||
Table widgets = new Table(1, 2, false);
|
||||
|
||||
widgets.Attach(new Entry("This is example Entry 1"), 0, 1, 0, 1);
|
||||
widgets.Attach(new Entry("This is example Entry 2"), 1, 2, 0, 1);
|
||||
|
||||
// Place the widgets in a Viewport, and the Viewport in a ScrolledWindow
|
||||
viewer.Add(widgets);
|
||||
scroller.Add(viewer);
|
||||
return scroller;
|
||||
}
|
||||
|
||||
public static int Main (string[] args)
|
||||
{
|
||||
Application.Init ();
|
||||
Window win = new Window ("Viewport Tester");
|
||||
win.SetDefaultSize (180, 50);
|
||||
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
|
||||
ScrolledWindow scroller = CreateViewport();
|
||||
win.Add (scroller);
|
||||
win.ShowAll ();
|
||||
Application.Run ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Window_Delete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
args.RetVal = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example></para>
|
||||
<para>Complete example: <code lang="C#" source="Viewport1.cs" /></para>
|
||||
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
|
@ -7,9 +7,7 @@
|
||||
namespace GtkSamples {
|
||||
|
||||
using Gtk;
|
||||
using GtkSharp;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
public class ViewportApp {
|
||||
|
||||
@ -33,7 +31,7 @@ namespace GtkSamples {
|
||||
{
|
||||
Application.Init ();
|
||||
Window win = new Window ("Viewport Tester");
|
||||
win.DefaultSize = new Size (180, 50);
|
||||
win.SetDefaultSize (180, 50);
|
||||
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
|
||||
ScrolledWindow scroller = CreateViewport();
|
||||
win.Add (scroller);
|
||||
|
@ -11,51 +11,44 @@
|
||||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<example>
|
||||
<code language="C#">
|
||||
<remarks>
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
class SvgHelloWorld
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static void Main (string[] args)
|
||||
{
|
||||
Gnome.Program program =
|
||||
new Gnome.Program("Hello World", "1.0", Gnome.Modules.UI, args);
|
||||
|
||||
MyMainWindow app = new MyMainWindow(program);
|
||||
app.Show();
|
||||
|
||||
program.Run();
|
||||
Application.Init ();
|
||||
MyMainWindow app = new MyMainWindow ();
|
||||
app.ShowAll ();
|
||||
Application.Run ();
|
||||
}
|
||||
}
|
||||
|
||||
class MyMainWindow
|
||||
: Gnome.App
|
||||
class MyMainWindow : Gtk.Window
|
||||
{
|
||||
Gnome.Program program;
|
||||
|
||||
public MyMainWindow(Gnome.Program gnome_program)
|
||||
: base("SVG Hello World", "SVG Hello World")
|
||||
public MyMainWindow () : base ("SVG Hello World")
|
||||
{
|
||||
this.program = gnome_program;
|
||||
|
||||
this.DeleteEvent += new GtkSharp.DeleteEventHandler(delete_event);
|
||||
|
||||
this.DeleteEvent += new DeleteEventHandler (delete_event);
|
||||
string svg_file_name = "sample.svg";
|
||||
Gdk.Pixbuf pixbuf = Rsvg.Tool.PixbufFromFile(svg_file_name);
|
||||
|
||||
Gtk.Image image = new Gtk.Image();
|
||||
Gdk.Pixbuf pixbuf = Rsvg.Tool.PixbufFromFile (svg_file_name);
|
||||
Image image = new Image ();
|
||||
image.Pixbuf = pixbuf;
|
||||
|
||||
this.Contents = image;
|
||||
this.Add (image);
|
||||
}
|
||||
|
||||
private void delete_event(object obj, GtkSharp.DeleteEventArgs args)
|
||||
private void delete_event (object obj, DeleteEventArgs args)
|
||||
{
|
||||
this.program.Quit();
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
}
|
||||
|
||||
</code>
|
||||
</example>
|
||||
</remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
|
@ -10,8 +10,9 @@
|
||||
</AssemblyInfo>
|
||||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<summary>A terminal widget implementation.
|
||||
</summary>
|
||||
<remarks>A <see cref="T:Vte.Terminal" /> is a terminal emulator implemented as a <see cref="T:Gtk.Widget" /></remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.Widget</BaseTypeName>
|
||||
@ -735,10 +736,10 @@
|
||||
<Parameter Name="gtype" Type="GLib.GType" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Internal Constructor.</summary>
|
||||
<param name="gtype">a <see cref="T:GLib.GType" /></param>
|
||||
<returns>a <see cref="T:Vte.Terminal" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>This should not be called by normal applications.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName=".ctor">
|
||||
@ -749,10 +750,10 @@
|
||||
<Parameter Name="raw" Type="System.IntPtr" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Internal Constructor.</summary>
|
||||
<param name="raw">a <see cref="T:System.IntPtr" /></param>
|
||||
<returns>a <see cref="T:Vte.Terminal" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks>This should not be called by normal user code.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName=".ctor">
|
||||
@ -761,9 +762,9 @@
|
||||
<ReturnValue />
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Default Constructor</summary>
|
||||
<returns>a <see cref="T:Vte.Terminal" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GType">
|
||||
|
Loading…
Reference in New Issue
Block a user