Skip to content

Commit

Permalink
Updated write-applet.xml - New example (Cin from 4.6 to 5.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux committed Jul 31, 2023
1 parent e91e044 commit c600656
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions docs/reference/cinnamon-tutorials/write-applet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
</informalexample>

<para>
Note that <link linkend="cinnamon-js-ui-Applet-IconApplet-set_applet_icon_symbolic_name"><code>set_applet_icon_symbolic_name</code></link> is a function defined inside <code>Applet.IconApplet</code>, which makes the applet display the corresponding icon. By using the applet API, we have saved ourselves from the hassle of creating icons and putting them in the right place. (<code>bell-notif</code> is the name of an icon from the user's icon set. The icons available for use can be found in <code>/usr/share/icons/</code> or in the <code>icons</code> folder of this applet)
Note that <link linkend="cinnamon-js-ui-Applet-IconApplet-set_applet_icon_symbolic_name"><code>set_applet_icon_symbolic_name</code></link> is a function defined inside <code>Applet.IconApplet</code>, which makes the applet display the corresponding icon. By using the applet API, we have saved ourselves from the hassle of creating icons and putting them in the right place. (<code>bell-notif</code> is the name of an icon from the user's icon set. The icons available for use can be found in <code>/usr/share/icons/</code> or in the <code>icons/</code> folder of this applet)
</para>

<para>
Expand All @@ -292,20 +292,5 @@
<para>
There is a way to translate messages such as "Click here to send a notification". Please see Translating applets.
</para>

<para>
That is all the code in our <code>_init</code> function. Now we have to wait for the user to click on the applet. The applet API automatically helps you to listen to these events, and when the user presses the applet, the API will call the <link linkend="cinnamon-js-ui-Applet-Applet-on_applet_clicked"><code>on_applet_clicked</code></link> of your applet. Here we have
</para>
<informalexample>
<programlisting>
on_applet_clicked: function() {
Util.spawn(['xkill']);
}
</programlisting>
</informalexample>

<para>
which calls the <code>spawn</code> function from <code>Util</code>, and launches an external command, <code>xkill</code>.
</para>
</sect2>
</chapter>

0 comments on commit c600656

Please sign in to comment.