ruby-libnotify 0.4.1.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. data/CHANGELOG.rdoc +12 -0
  2. data/README.rdoc +5 -7
  3. data/doc/Notify/Notification.html +1123 -0
  4. data/doc/Notify.html +518 -0
  5. data/doc/created.rid +3 -1
  6. data/doc/ext/rnotify_c.html +52 -0
  7. data/doc/images/brick.png +0 -0
  8. data/doc/images/brick_link.png +0 -0
  9. data/doc/images/bug.png +0 -0
  10. data/doc/images/bullet_black.png +0 -0
  11. data/doc/images/bullet_toggle_minus.png +0 -0
  12. data/doc/images/bullet_toggle_plus.png +0 -0
  13. data/doc/images/date.png +0 -0
  14. data/doc/images/find.png +0 -0
  15. data/doc/images/loadingAnimation.gif +0 -0
  16. data/doc/images/macFFBgHack.png +0 -0
  17. data/doc/images/package.png +0 -0
  18. data/doc/images/page_green.png +0 -0
  19. data/doc/images/page_white_text.png +0 -0
  20. data/doc/images/page_white_width.png +0 -0
  21. data/doc/images/plugin.png +0 -0
  22. data/doc/images/ruby.png +0 -0
  23. data/doc/images/tag_green.png +0 -0
  24. data/doc/images/wrench.png +0 -0
  25. data/doc/images/wrench_orange.png +0 -0
  26. data/doc/images/zoom.png +0 -0
  27. data/doc/index.html +93 -17
  28. data/doc/js/darkfish.js +116 -0
  29. data/doc/js/jquery.js +32 -0
  30. data/doc/js/quicksearch.js +114 -0
  31. data/doc/js/thickbox-compressed.js +10 -0
  32. data/doc/lib/RNotify_rb.html +56 -0
  33. data/doc/rdoc.css +706 -0
  34. data/examples/action.rb +1 -1
  35. data/examples/base.rb +1 -5
  36. data/examples/icon.png +0 -0
  37. data/examples/info.rb +1 -1
  38. data/examples/markup.rb +1 -4
  39. data/examples/multi-actions.rb +1 -1
  40. data/examples/update.rb +1 -6
  41. data/examples/urgency.rb +3 -8
  42. data/examples/xy.rb +1 -6
  43. data/ext/extconf.rb +23 -34
  44. data/ext/rnotify.c +72 -145
  45. data/lib/RNotify.rb +1 -1
  46. metadata +33 -52
  47. data/doc/classes/Notify/Notification.html +0 -787
  48. data/doc/classes/Notify/Notification.src/M000007.html +0 -65
  49. data/doc/classes/Notify/Notification.src/M000008.html +0 -49
  50. data/doc/classes/Notify/Notification.src/M000009.html +0 -43
  51. data/doc/classes/Notify/Notification.src/M000010.html +0 -35
  52. data/doc/classes/Notify/Notification.src/M000011.html +0 -33
  53. data/doc/classes/Notify/Notification.src/M000012.html +0 -36
  54. data/doc/classes/Notify/Notification.src/M000013.html +0 -48
  55. data/doc/classes/Notify/Notification.src/M000014.html +0 -36
  56. data/doc/classes/Notify/Notification.src/M000015.html +0 -38
  57. data/doc/classes/Notify/Notification.src/M000016.html +0 -38
  58. data/doc/classes/Notify/Notification.src/M000017.html +0 -39
  59. data/doc/classes/Notify/Notification.src/M000018.html +0 -38
  60. data/doc/classes/Notify/Notification.src/M000019.html +0 -45
  61. data/doc/classes/Notify/Notification.src/M000020.html +0 -67
  62. data/doc/classes/Notify/Notification.src/M000021.html +0 -33
  63. data/doc/classes/Notify/Notification.src/M000022.html +0 -33
  64. data/doc/classes/Notify/Notification.src/M000023.html +0 -36
  65. data/doc/classes/Notify/Notification.src/M000024.html +0 -34
  66. data/doc/classes/Notify.html +0 -343
  67. data/doc/classes/Notify.src/M000001.html +0 -39
  68. data/doc/classes/Notify.src/M000002.html +0 -24
  69. data/doc/classes/Notify.src/M000003.html +0 -25
  70. data/doc/classes/Notify.src/M000004.html +0 -24
  71. data/doc/classes/Notify.src/M000005.html +0 -37
  72. data/doc/classes/Notify.src/M000006.html +0 -55
  73. data/doc/files/lib/RNotify_rb.html +0 -102
  74. data/doc/files/rnotify_c.html +0 -90
  75. data/doc/fr_class_index.html +0 -27
  76. data/doc/fr_file_index.html +0 -27
  77. data/doc/fr_method_index.html +0 -71
  78. data/doc/rdoc-style.css +0 -299
  79. data/examples/attach_to.rb +0 -43
  80. data/examples/attach_to_status_icon.rb +0 -47
  81. data/examples/geometry-hints.rb +0 -37
@@ -1,102 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <title>File: RNotify.rb [RDoc Documentation]</title>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
8
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
9
- <script type="text/javascript">
10
- // <![CDATA[
11
-
12
- function popupCode( url ) {
13
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
14
- }
15
-
16
- function toggleCode( id ) {
17
- if ( document.getElementById )
18
- elem = document.getElementById( id );
19
- else if ( document.all )
20
- elem = eval( "document.all." + id );
21
- else
22
- return false;
23
-
24
- elemStyle = elem.style;
25
-
26
- if ( elemStyle.display != "block" ) {
27
- elemStyle.display = "block"
28
- } else {
29
- elemStyle.display = "none"
30
- }
31
-
32
- return true;
33
- }
34
-
35
- // Make codeblocks hidden by default
36
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
37
-
38
- // ]]>
39
- </script>
40
-
41
- </head>
42
- <body>
43
-
44
-
45
- <div id="fileHeader">
46
- <h1>RNotify.rb</h1>
47
- <table class="header-table">
48
- <tr class="top-aligned-row">
49
- <td><strong>Path:</strong></td>
50
- <td>lib/RNotify.rb
51
-
52
- </td>
53
- </tr>
54
- <tr class="top-aligned-row">
55
- <td><strong>Last Update:</strong></td>
56
- <td>2010-01-08 17:22:42 +0100</td>
57
- </tr>
58
- </table>
59
- </div>
60
- <!-- banner header -->
61
-
62
- <div id="bodyContent">
63
-
64
- <div id="contextContent">
65
-
66
- <div id="requires-list">
67
- <h3 class="section-bar">Required files</h3>
68
-
69
- <div class="name-list">
70
-
71
- gtk2&nbsp;&nbsp;
72
-
73
- rnotify.so&nbsp;&nbsp;
74
-
75
- </div>
76
- </div>
77
-
78
- </div>
79
-
80
-
81
- </div>
82
-
83
- <!-- if includes -->
84
-
85
- <div id="section">
86
-
87
-
88
-
89
-
90
- <!-- if method_list -->
91
-
92
-
93
-
94
-
95
- </div>
96
-
97
- <div id="validator-badges">
98
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
99
- </div>
100
-
101
- </body>
102
- </html>
@@ -1,90 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <title>File: rnotify.c [RDoc Documentation]</title>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
8
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
9
- <script type="text/javascript">
10
- // <![CDATA[
11
-
12
- function popupCode( url ) {
13
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
14
- }
15
-
16
- function toggleCode( id ) {
17
- if ( document.getElementById )
18
- elem = document.getElementById( id );
19
- else if ( document.all )
20
- elem = eval( "document.all." + id );
21
- else
22
- return false;
23
-
24
- elemStyle = elem.style;
25
-
26
- if ( elemStyle.display != "block" ) {
27
- elemStyle.display = "block"
28
- } else {
29
- elemStyle.display = "none"
30
- }
31
-
32
- return true;
33
- }
34
-
35
- // Make codeblocks hidden by default
36
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
37
-
38
- // ]]>
39
- </script>
40
-
41
- </head>
42
- <body>
43
-
44
-
45
- <div id="fileHeader">
46
- <h1>rnotify.c</h1>
47
- <table class="header-table">
48
- <tr class="top-aligned-row">
49
- <td><strong>Path:</strong></td>
50
- <td>rnotify.c
51
-
52
- </td>
53
- </tr>
54
- <tr class="top-aligned-row">
55
- <td><strong>Last Update:</strong></td>
56
- <td>2010-01-11 12:41:45 +0100</td>
57
- </tr>
58
- </table>
59
- </div>
60
- <!-- banner header -->
61
-
62
- <div id="bodyContent">
63
-
64
- <div id="contextContent">
65
-
66
- </div>
67
-
68
-
69
- </div>
70
-
71
- <!-- if includes -->
72
-
73
- <div id="section">
74
-
75
-
76
-
77
-
78
- <!-- if method_list -->
79
-
80
-
81
-
82
-
83
- </div>
84
-
85
- <div id="validator-badges">
86
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
87
- </div>
88
-
89
- </body>
90
- </html>
@@ -1,27 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <!--
5
-
6
- Classes [RDoc Documentation]
7
-
8
- -->
9
- <head>
10
- <title>Classes [RDoc Documentation]</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
13
- <base target="docwin" />
14
- </head>
15
- <body>
16
- <div class="index">
17
- <h1 class="section-bar">Classes</h1>
18
- <div id="index-entries">
19
-
20
- <a href="classes/Notify.html">Notify</a><br />
21
-
22
- <a href="classes/Notify/Notification.html">Notify::Notification</a><br />
23
-
24
- </div>
25
- </div>
26
- </body>
27
- </html>
@@ -1,27 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <!--
5
-
6
- Files [RDoc Documentation]
7
-
8
- -->
9
- <head>
10
- <title>Files [RDoc Documentation]</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
13
- <base target="docwin" />
14
- </head>
15
- <body>
16
- <div class="index">
17
- <h1 class="section-bar">Files</h1>
18
- <div id="index-entries">
19
-
20
- <a href="files/lib/RNotify_rb.html">lib/RNotify.rb</a><br />
21
-
22
- <a href="files/rnotify_c.html">rnotify.c</a><br />
23
-
24
- </div>
25
- </div>
26
- </body>
27
- </html>
@@ -1,71 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <!--
5
-
6
- Methods [RDoc Documentation]
7
-
8
- -->
9
- <head>
10
- <title>Methods [RDoc Documentation]</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
13
- <base target="docwin" />
14
- </head>
15
- <body>
16
- <div class="index">
17
- <h1 class="section-bar">Methods</h1>
18
- <div id="index-entries">
19
-
20
- <a href="classes/Notify/Notification.html#M000020">add_action (Notify::Notification)</a><br />
21
-
22
- <a href="classes/Notify.html#M000004">app_name (Notify)</a><br />
23
-
24
- <a href="classes/Notify/Notification.html#M000009">attach_to (Notify::Notification)</a><br />
25
-
26
- <a href="classes/Notify/Notification.html#M000012">category= (Notify::Notification)</a><br />
27
-
28
- <a href="classes/Notify/Notification.html#M000021">clear_actions (Notify::Notification)</a><br />
29
-
30
- <a href="classes/Notify/Notification.html#M000022">clear_hints (Notify::Notification)</a><br />
31
-
32
- <a href="classes/Notify/Notification.html#M000024">close (Notify::Notification)</a><br />
33
-
34
- <a href="classes/Notify/Notification.html#M000023">closed_reason (Notify::Notification)</a><br />
35
-
36
- <a href="classes/Notify/Notification.html#M000019">geometry_hints (Notify::Notification)</a><br />
37
-
38
- <a href="classes/Notify/Notification.html#M000015">hint32 (Notify::Notification)</a><br />
39
-
40
- <a href="classes/Notify/Notification.html#M000018">hint_byte (Notify::Notification)</a><br />
41
-
42
- <a href="classes/Notify/Notification.html#M000016">hint_double (Notify::Notification)</a><br />
43
-
44
- <a href="classes/Notify/Notification.html#M000017">hint_string (Notify::Notification)</a><br />
45
-
46
- <a href="classes/Notify.html#M000001">init (Notify)</a><br />
47
-
48
- <a href="classes/Notify.html#M000003">init? (Notify)</a><br />
49
-
50
- <a href="classes/Notify/Notification.html#M000007">new (Notify::Notification)</a><br />
51
-
52
- <a href="classes/Notify/Notification.html#M000014">pixbuf_icon= (Notify::Notification)</a><br />
53
-
54
- <a href="classes/Notify.html#M000005">server_caps (Notify)</a><br />
55
-
56
- <a href="classes/Notify.html#M000006">server_info (Notify)</a><br />
57
-
58
- <a href="classes/Notify/Notification.html#M000010">show (Notify::Notification)</a><br />
59
-
60
- <a href="classes/Notify/Notification.html#M000011">timeout= (Notify::Notification)</a><br />
61
-
62
- <a href="classes/Notify.html#M000002">uninit (Notify)</a><br />
63
-
64
- <a href="classes/Notify/Notification.html#M000008">update (Notify::Notification)</a><br />
65
-
66
- <a href="classes/Notify/Notification.html#M000013">urgency= (Notify::Notification)</a><br />
67
-
68
- </div>
69
- </div>
70
- </body>
71
- </html>
data/doc/rdoc-style.css DELETED
@@ -1,299 +0,0 @@
1
- body {
2
- font-family: Verdana,Arial,Helvetica,sans-serif;
3
- font-size: 90%;
4
- margin: 0;
5
- margin-left: 40px;
6
- padding: 0;
7
- background: white;
8
- color: black;
9
- }
10
-
11
- h1, h2, h3, h4 {
12
- margin: 0;
13
- background: transparent;
14
- }
15
-
16
- h1 {
17
- font-size: 150%;
18
- }
19
-
20
- h2,h3,h4 {
21
- margin-top: 1em;
22
- }
23
-
24
- :link, :visited {
25
- background: #eef;
26
- color: #039;
27
- text-decoration: none;
28
- }
29
-
30
- :link:hover, :visited:hover {
31
- background: #039;
32
- color: #eef;
33
- }
34
-
35
- /* Override the base stylesheet's Anchor inside a table cell */
36
- td > :link, td > :visited {
37
- background: transparent;
38
- color: #039;
39
- text-decoration: none;
40
- }
41
-
42
- /* and inside a section title */
43
- .section-title > :link, .section-title > :visited {
44
- background: transparent;
45
- color: #eee;
46
- text-decoration: none;
47
- }
48
-
49
- /* === Structural elements =================================== */
50
-
51
- .index {
52
- margin: 0;
53
- margin-left: -40px;
54
- padding: 0;
55
- font-size: 90%;
56
- }
57
-
58
- .index :link, .index :visited {
59
- margin-left: 0.7em;
60
- }
61
-
62
- .index .section-bar {
63
- margin-left: 0px;
64
- padding-left: 0.7em;
65
- background: #ccc;
66
- font-size: small;
67
- }
68
-
69
- #classHeader, #fileHeader {
70
- width: auto;
71
- color: white;
72
- padding: 0.5em 1.5em 0.5em 1.5em;
73
- margin: 0;
74
- margin-left: -40px;
75
- border-bottom: 3px solid #006;
76
- }
77
-
78
- #classHeader :link, #fileHeader :link,
79
- #classHeader :visited, #fileHeader :visited {
80
- background: inherit;
81
- color: white;
82
- }
83
-
84
- #classHeader td, #fileHeader td {
85
- background: inherit;
86
- color: white;
87
- }
88
-
89
- #fileHeader {
90
- background: #057;
91
- }
92
-
93
- #classHeader {
94
- background: #048;
95
- }
96
-
97
- .class-name-in-header {
98
- font-size: 180%;
99
- font-weight: bold;
100
- }
101
-
102
- #bodyContent {
103
- padding: 0 1.5em 0 1.5em;
104
- }
105
-
106
- #description {
107
- padding: 0.5em 1.5em;
108
- background: #efefef;
109
- border: 1px dotted #999;
110
- }
111
-
112
- #description h1, #description h2, #description h3,
113
- #description h4, #description h5, #description h6 {
114
- color: #125;
115
- background: transparent;
116
- }
117
-
118
- #validator-badges {
119
- text-align: center;
120
- }
121
-
122
- #validator-badges img {
123
- border: 0;
124
- }
125
-
126
- #copyright {
127
- color: #333;
128
- background: #efefef;
129
- font: 0.75em sans-serif;
130
- margin-top: 5em;
131
- margin-bottom: 0;
132
- padding: 0.5em 2em;
133
- }
134
-
135
- /* === Classes =================================== */
136
-
137
- table.header-table {
138
- color: white;
139
- font-size: small;
140
- }
141
-
142
- .type-note {
143
- font-size: small;
144
- color: #dedede;
145
- }
146
-
147
- .section-bar {
148
- color: #333;
149
- border-bottom: 1px solid #999;
150
- margin-left: -20px;
151
- }
152
-
153
- .section-title {
154
- background: #79a;
155
- color: #eee;
156
- padding: 3px;
157
- margin-top: 2em;
158
- margin-left: -30px;
159
- border: 1px solid #999;
160
- }
161
-
162
- .top-aligned-row {
163
- vertical-align: top
164
- }
165
-
166
- .bottom-aligned-row {
167
- vertical-align: bottom
168
- }
169
-
170
- #diagram img {
171
- border: 0;
172
- }
173
-
174
- /* --- Context section classes ----------------------- */
175
-
176
- .context-row { }
177
-
178
- .context-item-name {
179
- font-family: monospace;
180
- font-weight: bold;
181
- color: black;
182
- }
183
-
184
- .context-item-value {
185
- font-size: small;
186
- color: #448;
187
- }
188
-
189
- .context-item-desc {
190
- color: #333;
191
- padding-left: 2em;
192
- }
193
-
194
- /* --- Method classes -------------------------- */
195
-
196
- .method-detail {
197
- background: #efefef;
198
- padding: 0;
199
- margin-top: 0.5em;
200
- margin-bottom: 1em;
201
- border: 1px dotted #ccc;
202
- }
203
-
204
- .method-heading {
205
- color: black;
206
- background: #ccc;
207
- border-bottom: 1px solid #666;
208
- padding: 0.2em 0.5em 0 0.5em;
209
- }
210
-
211
- .method-signature {
212
- color: black;
213
- background: inherit;
214
- }
215
-
216
- .method-name {
217
- font-weight: bold;
218
- }
219
-
220
- .method-args {
221
- font-style: italic;
222
- }
223
-
224
- .method-description {
225
- padding: 0 0.5em 0 0.5em;
226
- }
227
-
228
- /* --- Source code sections -------------------- */
229
-
230
- :link.source-toggle, :visited.source-toggle {
231
- font-size: 90%;
232
- }
233
-
234
- div.method-source-code {
235
- background: #262626;
236
- color: #ffdead;
237
- margin: 1em;
238
- padding: 0.5em;
239
- border: 1px dashed #999;
240
- overflow: auto;
241
- }
242
-
243
- div.method-source-code pre {
244
- color: #ffdead;
245
- }
246
-
247
- /* --- Ruby keyword styles --------------------- */
248
-
249
- .standalone-code {
250
- background: #221111;
251
- color: #ffdead;
252
- overflow: auto;
253
- }
254
-
255
- .ruby-constant {
256
- color: #7fffd4;
257
- background: transparent;
258
- }
259
-
260
- .ruby-keyword {
261
- color: #00ffff;
262
- background: transparent;
263
- }
264
-
265
- .ruby-ivar {
266
- color: #eedd82;
267
- background: transparent;
268
- }
269
-
270
- .ruby-operator {
271
- color: #00ffee;
272
- background: transparent;
273
- }
274
-
275
- .ruby-identifier {
276
- color: #ffdead;
277
- background: transparent;
278
- }
279
-
280
- .ruby-node {
281
- color: #ffa07a;
282
- background: transparent;
283
- }
284
-
285
- .ruby-comment {
286
- color: #b22222;
287
- font-weight: bold;
288
- background: transparent;
289
- }
290
-
291
- .ruby-regexp {
292
- color: #ffa07a;
293
- background: transparent;
294
- }
295
-
296
- .ruby-value {
297
- color: #7fffd4;
298
- background: transparent;
299
- }
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- =begin
4
-
5
- attach_to.rb
6
-
7
- Luca Russo <vargolo@gmail.com>
8
- Copyright (LGPL) 2006 - 2011
9
-
10
- ruby-libnotify attach_to example
11
-
12
- =end
13
-
14
- begin
15
- require 'RNotify'
16
- rescue LoadError
17
- require 'rubygems'
18
- require 'RNotify'
19
- end
20
-
21
- Gtk.init
22
- Notify.init("Test9")
23
-
24
- win = Gtk::Window.new(Gtk::Window::TOPLEVEL)
25
- win.signal_connect("destroy") { Gtk.main_quit }
26
-
27
- bt = Gtk::Button.new("Click Me!")
28
-
29
- win.add(bt)
30
- win.show_all
31
-
32
- test = Notify::Notification.new("Attach_To", "Do you savvy? :P", nil, nil)
33
- test.attach_to(bt)
34
- test.timeout= Notify::Notification::EXPIRES_NEVER
35
- test.add_action("Attach_To", "Click Me!") { Gtk.main_quit }
36
-
37
- bt.signal_connect("clicked", test) { |wid,data| data.show }
38
-
39
- Gtk.main
40
-
41
- test.clear_actions
42
- test.close
43
- Notify.uninit
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- =begin
4
-
5
- attach_to_status_icon.rb
6
-
7
- Luca Russo <vargolo@gmail.com>
8
- Copyright (LGPL) 2006 - 2011
9
-
10
- ruby-libnotify attach_to_status_icon example
11
-
12
- =end
13
-
14
- begin
15
- require 'RNotify'
16
- rescue LoadError
17
- require 'rubygems'
18
- require 'RNotify'
19
- end
20
-
21
- Gtk.init
22
- Notify.init("Test11")
23
-
24
- win = Gtk::Window.new(Gtk::Window::TOPLEVEL)
25
- win.signal_connect("destroy") { Gtk.main_quit }
26
-
27
- bt = Gtk::Button.new("Click Me!")
28
-
29
- win.add(bt)
30
- win.show_all
31
-
32
- icon = Gdk::Pixbuf.new(File.dirname(__FILE__) + "/icon.png")
33
- st = Gtk::StatusIcon.new
34
- st.pixbuf=icon
35
-
36
- test = Notify::Notification.new("Attach_To", "Do you savvy? :P", nil, st)
37
- test.timeout= Notify::Notification::EXPIRES_NEVER
38
- test.pixbuf_icon=icon
39
- test.add_action("Attach_To", "Click Me!") { Gtk.main_quit }
40
-
41
- bt.signal_connect("clicked", test) { |wid,data| data.show }
42
-
43
- Gtk.main
44
-
45
- test.clear_actions
46
- test.close
47
- Notify.uninit