File: gtkrecent-chooser.html

package info (click to toggle)
gtk%2B2.0 2.20.1-2%2Bdeb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 136,284 kB
  • ctags: 66,487
  • sloc: ansic: 590,318; sh: 10,559; makefile: 5,573; xml: 1,357; python: 866; perl: 776; asm: 457; awk: 72; cpp: 34
file content (97 lines) | stat: -rw-r--r-- 7,282 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Displaying the Recently Used Documents</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="prev" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="next" href="gtkrecent-advanced.html" title="Advanced usage">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="gtk-migrating-GtkRecentChooser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gtk-migrating-GtkRecentChooser.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="gtkrecent-advanced.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section" title="Displaying the Recently Used Documents">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="gtkrecent-chooser"></a>Displaying the Recently Used Documents</h2></div></div></div>
<p>
      Displaying the Recently Used Documents list is handled by any widget
      implementing the <a class="link" href="GtkRecentChooser.html" title="GtkRecentChooser"><span class="type">GtkRecentChooser</span></a> interface. These widgets also handle
      the sorting and filtering of the list; they will create their own
      <a class="link" href="GtkRecentManager.html" title="GtkRecentManager"><span class="type">GtkRecentManager</span></a> objects by default:
      </p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>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</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="GtkWidget.html">GtkWidget</a> </span><span class="symbol">*</span><span class="normal">chooser</span><span class="symbol">;</span>
<span class="normal">	<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> response</span><span class="symbol">;</span>

<span class="normal">	</span><span class="comment">/* create a new dialog with the recently used documents list shown</span>
<span class="comment">	 * using a GtkTreeView widget</span>
<span class="comment">	 */</span>
<span class="normal">	chooser </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkRecentChooserDialog.html#gtk-recent-chooser-dialog-new">gtk_recent_chooser_dialog_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Recent Documents"</span><span class="symbol">,</span>
<span class="normal">	                                         parent_window</span><span class="symbol">,</span>
<span class="normal">						 <a href="gtk-Stock-Items.html#GTK-STOCK-CLOSE:CAPS">GTK_STOCK_CLOSE</a></span><span class="symbol">,</span><span class="normal"> <a href="GtkDialog.html#GTK-RESPONSE-CANCEL:CAPS">GTK_RESPONSE_CANCEL</a></span><span class="symbol">,</span>
<span class="normal">						 <a href="gtk-Stock-Items.html#GTK-STOCK-OPEN:CAPS">GTK_STOCK_OPEN</a></span><span class="symbol">,</span><span class="normal"> <a href="GtkDialog.html#GTK-RESPONSE-OK:CAPS">GTK_RESPONSE_OK</a></span><span class="symbol">,</span>
<span class="normal">						 <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="comment">/* set the sorting order to "most recently used first" */</span>
<span class="normal">	</span><span class="function"><a href="GtkRecentChooser.html#gtk-recent-chooser-set-sort-type">gtk_recent_chooser_set_sort_type</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_RECENT_CHOOSER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">),</span><span class="normal"> <a href="GtkRecentChooser.html#GTK-RECENT-SORT-MRU:CAPS">GTK_RECENT_SORT_MRU</a></span><span class="symbol">);</span>
<span class="normal">	response </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkDialog.html#gtk-dialog-run">gtk_dialog_run</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">));</span>
<span class="normal">	</span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">response </span><span class="symbol">==</span><span class="normal"> <a href="GtkDialog.html#GTK-RESPONSE-OK:CAPS">GTK_RESPONSE_OK</a></span><span class="symbol">)</span>
<span class="normal">	  </span><span class="cbracket">{</span>
<span class="normal">	    <a href="GtkRecentManager.html#GtkRecentInfo">GtkRecentInfo</a> </span><span class="symbol">*</span><span class="normal">info</span><span class="symbol">;</span>

<span class="normal">    info </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkRecentChooser.html#gtk-recent-chooser-get-current-item">gtk_recent_chooser_get_current_item</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_RECENT_CHOOSER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">));</span>
<span class="normal">	    </span><span class="function">do_something_with_the_item</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">info</span><span class="symbol">);</span>

<span class="normal">	    </span><span class="function"><a href="GtkRecentManager.html#gtk-recent-info-unref">gtk_recent_info_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">info</span><span class="symbol">);</span>
<span class="normal">	  </span><span class="cbracket">}</span>
<span class="normal">	</span>
<span class="normal">	</span><span class="function"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p>
    </p>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>