File: test.py

package info (click to toggle)
tinyerp-client 3.4.2-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,832 kB
  • ctags: 1,024
  • sloc: python: 7,566; sh: 2,253; makefile: 81
file content (30 lines) | stat: -rw-r--r-- 653 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import locale, gettext
gettext.install('test')
import pygtk
pygtk.require('2.0')
import gtk

import rpc
rpc.session.login('admin', 'admin', 'localhost', 8069)

from screen.screen import Screen
sc = Screen('res.country')

def switch(button, *args):
	print args
	button.current_id = (button.current_id + 1) % 4
	sc.display(button.current_id)

window = gtk.Window()
table = gtk.Table(2, 1)
window.add(table)
table.attach(sc.current_view.widget, 0, 1, 0, 1)
button = gtk.Button('next')
button.connect('clicked', switch)
table.attach(button, 0, 1, 1, 2)
window.show_all()
sc.load([11,22,33,44])
sc.display(0)
print sc.widget
button.current_id = 0
gtk.main()