Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > gnome.applet programming question.

Reply
Thread Tools

gnome.applet programming question.

 
 
Charlie Kim
Guest
Posts: n/a
 
      08-26-2003
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.
 
Reply With Quote
 
 
 
 
Nicholas Wieland
Guest
Posts: n/a
 
      08-27-2003
-Charlie Kim<NOSPAM__nabugoon__@__moor.pe.krNOSPAM>:
> any idea?


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

nicholas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C (functional programming) VS C++ (object oriented programming) Joe Mayo C Programming 168 10-22-2007 01:00 AM
Can Your Programming Language Do This? Joel on functional programming and briefly on anonymous functions! Casey Hawthorne Python 4 08-04-2006 05:23 AM
Wireless PEAP/MSCHAPV2 client programming question Jim Howard Wireless Networking 6 07-02-2005 11:53 AM
systems programming versus application programming Matt Java 35 07-22-2004 08:10 AM
XSLT programming cameron Firefox 0 01-04-2004 10:51 PM



Advertisments