Permalink
Browse files

Toolbar.js.page

  • Loading branch information...
1 parent 0fb57b6 commit 5f8a87dd86c25f7bf6fcf960dd5808c99d34f1cc @cannonerd committed Feb 6, 2012
Showing with 43 additions and 0 deletions.
  1. +43 −0 mallard/toolbar.js.page
View
@@ -0,0 +1,43 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ type="topic"
+ id="toolbar.js">
+
+ <info>
+ <link type="guide" xref="index#js"/>
+ <desc> Toolbar
+ </desc>
+ <revision pkgversion="0.1" version="0.1" date="2012-02-01" status="review"/>
+ <credit type="author">
+ <name>Susanna Huhtanen</name>
+ <email>ihmis.suski@gmail.com</email>
+ </credit>
+ </info>
+
+ <title>Toolbar</title>
+ <synopsis>
+ <p>
+ How to make a toolbar and how it works. In this section we will go thorought the following parts
+ </p>
+ <list>
+ <item><p> code for toolbar</p></item>
+ <item><p> custom widgets for a toolbar</p></item>
+ <item><p> </p></item>
+ </list>
+ </synopsis>
+ <section id="code for toolbar">
+ <title>Code for toolbar</title>
+ <p>The code itself is quite simple. You just create a toolbar instance and insert the needed objects inside the toolbar. </p>
+<code mime="text/javascript" style="numbered"><![CDATA[
+var toolbar = new Gtk.Toolbar();
+toolbar.set_style(Gtk.ToolbarStyle.ICONS);
+var buttonQuit = new Gtk.ToolButton.new_from_stock(Gtk.STOCK_QUIT);//();
+toolbar.insert(buttonQuit, 0)
+
+//remember to add and show your toolbar in the correct box.
+
+your_box.add(toolbar);
+your_box.show_all();]]></code>
+<p>As you see, the code itself it's quite simple. Showing just a button in this case doesn't do the trick, the buttom must be connected to a signal. In this case the buttonQuit should be connected to Gtk.main_quit()</p>
+ </section>
+</page>
+

0 comments on commit 5f8a87d

Please sign in to comment.