File: Application.xml

package info (click to toggle)
gtk-sharp3 2.99.3-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 25,488 kB
  • sloc: xml: 308,885; cs: 38,796; sh: 11,336; perl: 1,295; makefile: 1,099; ansic: 903
file content (506 lines) | stat: -rw-r--r-- 20,205 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<Type Name="Application" FullName="Gtk.Application">
  <TypeSignature Language="C#" Value="public class Application : GLib.Application" Maintainer="John Luke" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi Application extends GLib.Application" />
  <AssemblyInfo>
    <AssemblyName>gtk-sharp</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
  </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>
  <Base>
    <BaseTypeName>GLib.Application</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Application class</summary>
    <remarks>
      <para>
	Provides the initialization and event loop iteration related
	methods for the Gtk# widget library.  Since Gtk# is an event 
	driven toolkit, Applications register callbacks against various
	events to handle user input. These callbacks are invoked from
	the main event loop when events are detected.
      </para>
      <example>
        <code lang="C#">
using Gtk;
using System;
using GLib;

public class HelloWorld  {

	public static int Main (string[] args)
	{
		Application.Init ();
		Gtk.Window win = new Gtk.Window ("Gtk# Hello World");
		win.DeleteEvent += new DeleteEventHandler (Window_Delete);
		win.ShowAll ();
		Application.Run ();
		return 0;
	}

	static void Window_Delete (object obj, DeleteEventArgs args)
	{
		SignalArgs sa = (SignalArgs) args;
		Application.Quit ();
		sa.RetVal = true;
	}
}
        </code>
      </example>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public Application (IntPtr raw);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int raw) cil managed" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="raw" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <param name="raw">Native object pointer.</param>
        <summary>Internal constructor</summary>
        <remarks>This is not typically used by C# code.  Exposed primarily for use by language bindings to wrap native object instances.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public Application (string application_id, GLib.ApplicationFlags flags);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string application_id, valuetype GLib.ApplicationFlags flags) cil managed" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="application_id" Type="System.String" />
        <Parameter Name="flags" Type="GLib.ApplicationFlags" />
      </Parameters>
      <Docs>
        <param name="application_id">To be added.</param>
        <param name="flags">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
    <Member MemberName="AddWindow">
      <MemberSignature Language="C#" Value="public void AddWindow (Gtk.Window window);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddWindow(class Gtk.Window window) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="window" Type="Gtk.Window" />
      </Parameters>
      <Docs>
        <param name="window">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
    <Member MemberName="CurrentEvent">
      <MemberSignature Language="C#" Value="public static Gdk.Event CurrentEvent { get; }" />
      <MemberSignature Language="ILAsm" Value=".property class Gdk.Event CurrentEvent" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>Gdk.Event</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Returns the event currently taking place.</summary>
        <value>a <see cref="T:Gdk.Event" /></value>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="EventsPending">
      <MemberSignature Language="C#" Value="public static bool EventsPending ();" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool EventsPending() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Whether there are events on the queue</summary>
        <returns>
          <see langword="true" /> if events are available to be processed, <see langword="false" /> otherwise</returns>
        <remarks>
          <para>
	    Checks if any events are pending. This can be used to
	    update the GUI and invoke timeouts etc. while doing some
	    time intensive computation.
	  </para>
          <example>
            <code lang="C#">
void LongComputation ()
{
	while (!done){
	    ComputationChunk ();

    	// Flush pending events to keep the GUI reponsive
    	while (Application.EventsPending ())
		    Application.RunIteration ();
	}
}
	    </code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="GType">
      <MemberSignature Language="C#" Value="public static GLib.GType GType { get; }" />
      <MemberSignature Language="ILAsm" Value=".property valuetype GLib.GType GType" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>GLib.GType</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>GType Property.</summary>
        <value>The native <see cref="T:GLib.GType" /> value.</value>
        <remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gtk.Application" />.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
    <Member MemberName="Init">
      <MemberSignature Language="C#" Value="public static void Init ();" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Init() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Initializes GTK+ for operation.</summary>
        <remarks>
          <para>
	    Call this function before using any other Gtk# functions
	    in your GUI applications. It will initialize everything
	    needed to operate the toolkit.
	  </para>
          <para>
	    This function will terminate your program if it was unable
	    to initialize the GUI for some reason. If you want your
	    program to fall back to a textual interface you want to
	    call <see cref="M:Gtk.Application.InitCheck(System.String, System.String []&amp;)" /> instead.
	  </para>
          <para>
	    If you want to pass arguments from the command line use
	    the <see cref="T:Gtk.Application.Init(System.String, System.String []&amp;)" />
	    method instead. 
	  </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Init">
      <MemberSignature Language="C#" Value="public static void Init (string progname, ref string[] args);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Init(string progname, string[] args) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="progname" Type="System.String" />
        <Parameter Name="args" Type="System.String[]&amp;" RefType="ref" />
      </Parameters>
      <Docs>
        <param name="progname">The name of the program.</param>
        <param name="args">An string array with the parameters given to the program.</param>
        <summary>Call this method before using any other GTK# method in your GUI applications.</summary>
        <remarks>
          <para>
	    It will initialize everything needed to operate the toolkit and parses some standard command line options, <paramref name="args" /> is adjusted accordingly so your code will never see those standard arugments.
	  </para>
          <para>
	    Note that there are some alternative ways to initialize GTK#, if you are calling <see cref="M:Gtk.Global.ParseArgs" /> or <see cref="M:Gtk.Application.InitCheck" /> you don't have to call <see cref="M:Gtk.Application.Init" />.
	  </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="InitCheck">
      <MemberSignature Language="C#" Value="public static bool InitCheck (string progname, ref string[] args);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool InitCheck(string progname, string[] args) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="progname" Type="System.String" />
        <Parameter Name="args" Type="System.String[]&amp;" RefType="ref" />
      </Parameters>
      <Docs>
        <param name="progname">The name of the program.</param>
        <param name="args">An string array with the parameters given to the program.</param>
        <summary>This method does the same work as <see cref="M:Gtk.Application.Init" /> with only a single change, it does not terminate the program if the GUI can't be initialized. Instead it returns <see langword="false" /> on failure.</summary>
        <returns>
          <see langword="" /> if the GUI has been succesfully initialized, otherwise <see langword="false" />.</returns>
        <remarks>This way the application can fall back to some toher means of communication with the user, for example a curses or command line interface.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Invoke">
      <MemberSignature Language="C#" Value="public static void Invoke (EventHandler d);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Invoke(class System.EventHandler d) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="d" Type="System.EventHandler" />
      </Parameters>
      <Docs>
        <param name="d">An event handler to invoke on the main thread.</param>
        <summary>Invoke the given EventHandler in the GUI thread.</summary>
        <remarks>
	   Use this method to invoke the given delegate code in the
    	   main thread.  This is necessary since Gtk# does not allow
	   multiple threads to perform operations on Gtk objects as it
	   the toolkit is not thread-safe.
	   <para>
	     This mechanism is simpler to use than <see cref="T:Gtk.ThreadNotify" /> since it does not require the
    	     creation of a notifier per event.
	   </para><para>
	     This is particularly useful with C# 2.0 as it is possible
	     to use anonymous methods with it, for example:
	   </para><example><code lang="C#">
	using Gtk;
	using Gdk;
	using System;
	using System.Threading;

	public class HelloThreads  {
		static Label msg;
		static Button but;
		static int count;
		static Thread thr;
		
		public static int Main (string[] args)
		{
			Application.Init ();
			Gtk.Window win = new Gtk.Window ("Gtk# Threaded Counter");
			win.DeleteEvent += new DeleteEventHandler (Window_Delete);
			msg = new Label ("Click to quit");
			but = new Button (msg);
			but.Clicked += delegate { thr.Abort (); Application.Quit (); };
			win.Add (but);
			win.ShowAll ();

			thr = new Thread (ThreadMethod);
			thr.Start ();
			
			Application.Run ();
			
			return 0;
		}

		static void ThreadMethod ()
		{
			Console.WriteLine ("Starting thread");
			while (true){
				count++;
				Thread.Sleep (500);
				Application.Invoke (delegate {
					msg.Text = String.Format ("Click to Quit ({0})", count);
				});
			}
		}
		
		static void Window_Delete (object obj, DeleteEventArgs args)
		{
			Application.Quit ();
			args.RetVal = true;
		}
        </code></example></remarks>
      </Docs>
    </Member>
    <Member MemberName="Invoke">
      <MemberSignature Language="C#" Value="public static void Invoke (object sender, EventArgs args, EventHandler d);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Invoke(object sender, class System.EventArgs args, class System.EventHandler d) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="sender" Type="System.Object" />
        <Parameter Name="args" Type="System.EventArgs" />
        <Parameter Name="d" Type="System.EventHandler" />
      </Parameters>
      <Docs>
        <param name="sender">The sender to pass to the event handler..</param>
        <param name="args">The argument to pass to the event handler.</param>
        <param name="d">An event handler to invoke on the main thread.</param>
        <summary>Invoke the given EventHandler in the GUI thread.</summary>
        <remarks>
    	   Use this method to invoke the given delegate code in the
        	   main thread.  This is necessary since Gtk# does not allow
    	   multiple threads to perform operations on Gtk objects as it
    	   the toolkit is not thread-safe.
    	   <para>
    	     This mechanism is simpler to use than <see cref="T:Gtk.ThreadNotify" /> since it does not require the
        	     creation of a notifier per event.
    	   </para><para>
    	     This is particularly useful with C# 2.0 as it is possible
    	     to use anonymous methods with it, for example:
    	   </para><example><code lang="C#">
    	using Gtk;
    	using Gdk;
    	using System;
    	using System.Threading;
    
    	public class HelloThreads  {
    		static Label msg;
    		static Button but;
    		static int count;
    		static Thread thr;
    		
    		public static int Main (string[] args)
    		{
    			Application.Init ();
    			Gtk.Window win = new Gtk.Window ("Gtk# Threaded Counter");
    			win.DeleteEvent += new DeleteEventHandler (Window_Delete);
    			msg = new Label ("Click to quit");
    			but = new Button (msg);
    			but.Clicked += delegate { thr.Abort (); Application.Quit (); };
    			win.Add (but);
    			win.ShowAll ();
    
    			thr = new Thread (ThreadMethod);
    			thr.Start ();
    			
    			Application.Run ();
    			
    			return 0;
    		}
    
    		static void ThreadMethod ()
    		{
    			Console.WriteLine ("Starting thread");
    			while (true){
    				count++;
    				Thread.Sleep (500);
    				Application.Invoke (delegate {
    					msg.Text = String.Format ("Click to Quit ({0})", count);
    				});
    			}
    		}
    		
    		static void Window_Delete (object obj, DeleteEventArgs args)
    		{
    			Application.Quit ();
    			args.RetVal = true;
    		}
            </code></example></remarks>
      </Docs>
    </Member>
    <Member MemberName="Quit">
      <MemberSignature Language="C#" Value="public static void Quit ();" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Quit() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Quits the current main loop</summary>
        <remarks>
          <para>
	    Makes the innermost invocation of the main loop return when it regains control.
	  </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="RemoveWindow">
      <MemberSignature Language="C#" Value="public void RemoveWindow (Gtk.Window window);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveWindow(class Gtk.Window window) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="window" Type="Gtk.Window" />
      </Parameters>
      <Docs>
        <param name="window">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
    <Member MemberName="Run">
      <MemberSignature Language="C#" Value="public static void Run ();" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Run() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Runs the main loop</summary>
        <remarks>
          <para>
	    Runs the main loop until <see cref="M:Gtk.Application.Quit()" /> is called. You can nest
	    calls to <see cref="M:Gtk.Application.Run()" />.  In that
	    case <see cref="M:Gtk.Application.Quit()" /> will make the
	    innermost invocation of the main loop return.
	  </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="RunIteration">
      <MemberSignature Language="C#" Value="public static void RunIteration ();" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void RunIteration() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Runs a single iteration of the main loop.</summary>
        <remarks>
          <para>
	    Runs a single iteration of the main loop. If no events are
	    waiting to be processed Gtk# will block until the next
	    event is noticed.  If you do not want to block look at <see cref="M:Gtk.Application.RunIteration(System.Boolean)" /> or check if
	    any events are pending with <see cref="M:Gtk.Application.EventsPending()" /> first.
	  </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="RunIteration">
      <MemberSignature Language="C#" Value="public static bool RunIteration (bool blocking);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool RunIteration(bool blocking) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="blocking" Type="System.Boolean" />
      </Parameters>
      <Docs>
        <param name="blocking">A boolean value, whether the iteration should block or not</param>
        <summary>Runs a single iteration of the main loop.</summary>
        <returns>
          <see langword="true" /> if <see cref="M:Gtk.Application.Quit()" /> has been called in the innermost main loop.</returns>
        <remarks>
          <para>
            Runs a single iteration of the main loop. If <paramref name="blocking" /> is <see langword="true" />, then if no events are
            waiting to be processed Gtk# will block until the next event is noticed; If <paramref name="blocking" /> is <see langword="false" />,
            then it if no events are waiting to be processed Gtk#, routine will return immediately.
          </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Windows">
      <MemberSignature Language="C#" Value="public Gtk.Window[] Windows { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class Gtk.Window[] Windows" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>Gtk.Window[]</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>To be added.</summary>
        <value>To be added.</value>
        <remarks>To be added.</remarks>
        <since version="Gtk# 3.0" />
      </Docs>
    </Member>
  </Members>
</Type>