61
by Ken VanDine
Added python example that uses libgwibber-gtk with introspection |
1 |
#!/usr/bin/python
|
2 |
#
|
|
3 |
# Copyright (C) 2010 Canonical Ltd.
|
|
4 |
#
|
|
5 |
# This library is free software; you can redistribute it and/or modify
|
|
6 |
# it under the terms of the GNU Lesser General Public License
|
|
7 |
# version 3.0 as published by the Free Software Foundation.
|
|
8 |
#
|
|
9 |
# This library is distributed in the hope that it will be useful,
|
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
# GNU Lesser General Public License version 3.0 for more details.
|
|
13 |
#
|
|
14 |
# You should have received a copy of the GNU Lesser General Public
|
|
15 |
# License along with this library. If not, see
|
|
16 |
# <http://www.gnu.org/licenses/>.
|
|
17 |
#
|
|
18 |
# Authored by Ken VanDine <ken.vandine@canonical.com>
|
|
19 |
#
|
|
20 |
||
21 |
from gi.repository import Gtk |
|
22 |
from gi.repository import GwibberGtk |
|
23 |
||
24 |
class GwibberEntry: |
|
25 |
def __init__(self): |
|
26 |
window = Gtk.Window() |
|
27 |
window.set_title("Gwibber Poster") |
|
28 |
window.resize(400,150) |
|
29 |
entry = GwibberGtk.GwibberEntry() |
|
30 |
window.add(entry) |
|
31 |
window.show_all() |
|
32 |
window.present() |
|
33 |
window.connect("destroy", self.on_close) |
|
34 |
||
35 |
def on_close(self, w): |
|
36 |
Gtk.main_quit() |
|
37 |
||
38 |
ge = GwibberEntry() |
|
39 |
Gtk.main() |