| The Following 3 Users Say Thank You to qwerty12 For This Useful Post: | ||
|
|
2009-05-05
, 13:29
|
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#2
|
|
|
2009-10-26
, 17:27
|
|
|
Posts: 3,397 |
Thanked: 1,212 times |
Joined on Jul 2008
@ Netherlands
|
#3
|
Built the python-vte bindings that come part of vte but are removed in diablo's vte. Took the package, added back in the python-vte bindings and modified the package to only give me the python-vte bindings without the vte library.
In Diablo extras-devel. If you need it for an application in Extras, feel free to promote.
Oh, I also did an one line fix to the vte reaper python support patch so this has support for the vte.Reaper object.
Here's a quick & dirty sample program I wrote:
#! /usr/bin/env python """ DO WHAT THE **** YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar 14 rue de Plaisance, 75014 Paris, France Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE **** YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE **** YOU WANT TO. """ import hildon import gtk import vte def on_window_state_change(widget, event, *args): global window_in_fullscreen if event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN: window_in_fullscreen = True else: window_in_fullscreen = False def on_key_press(widget, event, *args): global window_in_fullscreen if event.keyval == gtk.keysyms.F6: if window_in_fullscreen: gtk.Window.unfullscreen (widget) else: gtk.Window.fullscreen (widget) def main(): def xterm_clicked(widget, terminal): terminal.show() terminal.fork_command() def lock_tablet(widget, terminal): terminal.show() #terminal.fork_command() #terminal.feed_child("run-standalone.sh /usr/bin/dbus-send --print-reply --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:'com.nokia.mce' string:'/com/nokia/mce/request' string:'com.nokia.mce.request' string:'devlock_callback' uint32:'3'\n") terminal.fork_command("run-standalone.sh /usr/bin/dbus-send --print-reply --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:'com.nokia.mce' string:'/com/nokia/mce/request' string:'com.nokia.mce.request' string:'devlock_callback' uint32:'3'") window = hildon.Window() gtk.set_application_name("VTE Terminal Example") window.connect("destroy", gtk.main_quit) window.connect("key-press-event", on_key_press) window.connect("window-state-event", on_window_state_change) window.fullscreen() window_in_fullscreen = True mainbox = gtk.VBox(False, 0) hb1 = gtk.HBox(False, 0) xterm_dlg_button = gtk.Button("Show terminal") lock_dlg_button = gtk.Button("Lock tablet") hb1.pack_start(xterm_dlg_button, True, True, 0) hb1.pack_start(lock_dlg_button, True, True, 0) terminal = vte.Terminal () #terminal.connect ("child-exited", lambda term: gtk.main_quit()) hb2 = gtk.HBox(False, 0) hb2.pack_start(terminal, True, True, 0) mainbox.pack_start(hb1, False, False, 0) mainbox.pack_start(hb2, True, True, 0) window.add(mainbox) xterm_dlg_button.connect("clicked", xterm_clicked, terminal) lock_dlg_button.connect("clicked", lock_tablet, terminal) window.show_all() terminal.hide() gtk.main() main()Last edited by qwerty12; 2009-05-06 at 15:10.