Browse Source

Add simple toolbars example

master
Aleksey Lim 13 years ago
parent
commit
2fc1cab92d
  1. 1
      examples/sugar
  2. 32
      examples/toolbar.py
  3. 2
      m4/.gitignore
  4. 14
      src/sugar/__init__.py
  5. 1
      src/sugar/_sugarext.so

1
examples/sugar

@ -0,0 +1 @@ @@ -0,0 +1 @@
../src/sugar/

32
examples/toolbar.py

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
import gtk
from sugar.graphics.toolbar import Toolbar, ToolbarButton
window = gtk.Window()
box = gtk.VBox()
window.add(box)
toolbar = Toolbar()
box.pack_start(toolbar, False)
tollbarbutton_1 = ToolbarButton(toolbar, gtk.Button('1'),
icon_name='computer-xo',
tooltip='foo')
toolbar.top.insert(tollbarbutton_1, -1)
toolbar.top.insert(gtk.SeparatorToolItem(), -1)
tollbarbutton_2 = ToolbarButton(toolbar, gtk.Button('1'),
icon_name='button_cancel',
tooltip='foo')
toolbar.top.insert(tollbarbutton_2, -1)
toolbar.top.insert(gtk.SeparatorToolItem(), -1)
tollbarbutton_3 = ToolbarButton(toolbar, gtk.Button('3'),
icon_name='activity-journal',
tooltip='foo')
toolbar.top.insert(tollbarbutton_3, -1)
window.show_all()
gtk.main()

2
m4/.gitignore vendored

@ -1 +1,3 @@ @@ -1 +1,3 @@
intltool.m4
libtool.m4
lt*.m4

14
src/sugar/__init__.py

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

1
src/sugar/_sugarext.so

@ -0,0 +1 @@ @@ -0,0 +1 @@
.libs/_sugarext.so
Loading…
Cancel
Save