Package elisa :: Package plugins :: Package bad :: Package gtk_frontend :: Module gtk_context
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.bad.gtk_frontend.gtk_context

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 
 4  # All rights reserved. 
 5  # 
 6  # This file is available under one of two license agreements. 
 7  # 
 8  # This file is licensed under the GPL version 3. 
 9  # See "LICENSE.GPL" in the root of this distribution including a special 
10  # exception to use Elisa with Fluendo's plugins. 
11  # 
12  # The GPL part of Elisa is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Elisa" in the root directory of this distribution package 
15  # for details on that license. 
16   
17   
18  __maintainer__ = 'Lionel Martin <lionel@fluendo.com>' 
19  __maintainer2__ = 'Florian Boucault <florian@fluendo.com>' 
20   
21  import pygtk 
22  pygtk.require('2.0') 
23  import gtk 
24   
25  from elisa.base_components.context import Context 
26  from elisa.core import common 
27   
28 -class GtkContext(Context):
29
30 - def initialize(self):
31 Context.initialize(self) 32 self._context_handle = None 33 window = gtk.Window(gtk.WINDOW_TOPLEVEL) 34 self.viewport_handle = window 35 window.connect("delete_event", self._delete_event)
36
37 - def _delete_event(self, widget, event, data=None):
39
40 - def context_handle__set(self, context_handle):
41 if isinstance(context_handle, gtk.Widget): 42 self._context_handle = context_handle 43 self.viewport_handle.add(context_handle) 44 self.viewport_handle.resize(350,800) 45 self.viewport_handle.show_all() 46 else: 47 raise TypeError("%r should be a gtk.Widget" % context_handle)
48
49 - def context_handle__get(self):
50 return self._context_handle
51