I investigated this another way: from near-zero. I tried the sample python applet in the docs of python-gnomeapplet. I also made a very small version of dockbarx, in the hope that it would give insight into why it does not work. Here is a dockbarx factory class that does not cause the error.
#!/usr/bin/python
# Copyright 2008, 2009, 2010 Aleksey Shaferov and Matias Sars
#
# DockBar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DockBar 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dockbar. If not, see <http://www.gnu.org/licenses/>.
#self.pp_menu_verbs = [("About", self.on_ppm_about), #("Pref", self.on_ppm_pref), #("Reload", self.reload)] #self.applet.setup_menu(self.pp_menu_xml, self.pp_menu_verbs,None) self.applet_origin_x = -1000 # off screen. there is no 'window' prop self.applet_origin_y = -1000 # at this step self.applet.set_background_widget(applet) # background bug workaround self.applet.show_all() #gobject.idle_add(self.idle_init)
else: self.container = gtk.HBox() self.orient = "h" #self.idle_init()
def cleanup(self,event):
del self.applet
class DockBarWindow():
"""DockBarWindow sets up the window if run-in-window is used."""
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_default_size(200,40) self.window.show() self.window.set_property("skip-taskbar-hint",True) self.window.set_keep_above(True) self.window.connect ("delete_event",self.delete_event) self.window.connect ("destroy",self.destroy)
I investigated this another way: from near-zero. I tried the sample python applet in the docs of python-gnomeapplet. I also made a very small version of dockbarx, in the hope that it would give insight into why it does not work. Here is a dockbarx factory class that does not cause the error.
#!/usr/bin/python
# Copyright 2008, 2009, 2010 Aleksey Shaferov and Matias Sars www.gnu. org/licenses/>.
#
# DockBar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DockBar 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dockbar. If not, see <http://
import pygtk '2.0')
pygtk.require(
import gtk
import gobject
import gnomeapplet
import sys
class DockBar( gobject. GObject) : SIGNAL_ RUN_FIRST, gobject. TYPE_NONE, ()), _(self, applet) :
gobject. GObject. __init_ _(self)
__gsignals__ = {
"db-move": (gobject.
}
def __init_
print "Dockbarx init"
self.applet = applet
#--- Applet / Window container
self. applet. set_applet_ flags(gnomeappl et.HAS_ HANDLE| gnomeapplet. EXPAND_ MINOR) get_orient( ) == gnomeapplet. ORIENT_ DOWN or applet.get_orient() == gnomeapplet. ORIENT_ UP:
self. orient = "h"
self. container = gtk.HBox()
self. orient = "v"
self. container = gtk.VBox()
self. applet. connect( "change- orient" ,self.on_ change_ orient)
self. applet. connect( "delete- event", self.cleanup)
self. applet. add(self. container)
self. applet. connect( "size-allocate" ,self.on_ applet_ size_alloc)
self. applet. connect( "change_ background" , self.on_ change_ background)
self. pp_menu_ xml = """
<menuitem name="About Item" verb="About" stockid="gtk-about" />
<menuitem name="Preferences" verb="Pref" stockid= "gtk-properties " />
<menuitem name="Reload" verb="Reload" stockid= "gtk-refresh" />
</ popup>
if self.applet != None:
if self.applet.
else:
<popup name="button3">
"""
else:
def cleanup( self,event) :
del self.applet
class DockBarWindow(): DockBarWindow sets up the window if run-in-window is used.""" gtk.WINDOW_ TOPLEVEL)
self.window. set_default_ size(200, 40)
self.window. show()
self.window. set_property( "skip-taskbar- hint",True)
self.window. set_keep_ above(True)
self.window. connect ("delete_ event", self.delete_ event)
self.window. connect ("destroy" ,self.destroy)
"""
def __init__(self):
self.window = gtk.Window(
hbox = gtk.HBox()
button = gtk.Button('Pref')
eb = gtk.EventBox()
## eb.modify_
def delete_event (self,widget, event,data= None):
return False
def destroy (self,widget, data=None) :
gtk.main_ quit()
def main(self):
gtk.main()
def dockbar_ factory( applet, iid): set_background_ widget( applet) show_all( )
dockbar = DockBar(applet)
applet.
applet.
return True
##gc.enable()
if len(sys.argv) == 2 and sys.argv[1] == "run-in-window": main() .bonobo_ factory( "OAFIID: GNOME_DockBarXA pplet_Factory" ,
gnomeapplet. Applet. __gtype_ _,
"dockbar applet", "0", dockbar_factory)
dockbarwin = DockBarWindow()
dockbarwin.
else:
gnomeapplet