gnome.applet programming question.

Discussion in 'Python' started by Charlie Kim, Aug 26, 2003.

  1. Charlie Kim

    Charlie Kim Guest

    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_Factory",
    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.
     
    Charlie Kim, Aug 26, 2003
    #1
    1. Advertising

  2. -Charlie Kim<NOSPAM__nabugoon__@__moor.pe.krNOSPAM>:
    > any idea?


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

    nicholas
     
    Nicholas Wieland, Aug 27, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger Levy
    Replies:
    0
    Views:
    363
    Roger Levy
    Feb 26, 2004
  2. nabugoon

    gnome applet with python

    nabugoon, Jul 30, 2003, in forum: Python
    Replies:
    1
    Views:
    415
    Cliff Wells
    Jul 30, 2003
  3. Joe Van Dyk

    ruby gnome question

    Joe Van Dyk, Jul 21, 2005, in forum: Ruby
    Replies:
    9
    Views:
    124
    Daniel Brockman
    Jul 22, 2005
  4. Joe Van Dyk

    ruby-gnome on gnome-2.10

    Joe Van Dyk, Jul 25, 2005, in forum: Ruby
    Replies:
    3
    Views:
    157
    Joe Van Dyk
    Jul 25, 2005
  5. Mike Durham

    Ruby Gnome Gtk event source question

    Mike Durham, Jun 26, 2006, in forum: Ruby
    Replies:
    0
    Views:
    88
    Mike Durham
    Jun 26, 2006
Loading...

Share This Page