By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

gnome.applet programming question.

P: n/a
Here is gnome applet source of mine.

--------------------------------------------------

#!/usr/bin/env python

import pydic
import gtk
import gnome.applet

class PyDicApplet(gtk.HBox):
def __init__(self, applet):
gtk.HBox.__init__(self, spacing=3)
entry = gtk.Entry()
entry.connect("key_press_event", self.entry_cb)
self.add(entry)

button = gtk.Button(unicode("ã", "euc-kr"))
#butoon.connect("button-press-event", self.button_press_cb, applet)
#button.connect("clicked", self.button_cb, entry)
self.pack_end(button, gtk.FALSE)

self.win = pydic.MainWindow()

def entry_cb(self, widget, event):
key = event.keyval

if key == 65293:
self.win.Show(True)
self.win.search(entry.get_text())

def button_press_cb(self, widget, event, applet):
if event.button == 3:
applet.emit("button_press_event", event)
return gtk.FALSE

def buttob_cb(self, widget, entry):
pass

def destroy_cb(applet, widget):
pass

def sleeper():
gtk.timeout_add(33, sleeper)
time.sleep(0.001)

def dic_factory(applet, iid):
gtk.timeout_add(33, sleeper)
d = PyDicApplet(applet)
applet.connect("destroy", destroy_cb, d)
applet.add(d)
applet.show_all()

return gtk.TRUE

gnome.applet.bonobo_factory("OAFIID:GNOME_PyDic_Fa ctory",
gnome.applet.Applet.__gtype__,
"pydic", "0", dic_factory)

-----------------------------------------------------

It works fine.

but, when I uncomment 15, 16 line, applet run without error but not appear
in panel.

any idea?

TIA.
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-Charlie Kim<NOSPAM__nabugoon__@__moor.pe.krNOSPAM>:
any idea?


Yes, subscribe to the pygtk mailing list :)
Sorry, I've never used gnome.applet ...

nicholas
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.