[pygtk] dynamic tooltip not working with new toolbar API
Here are some code snipits, This code works correctly for the old tollbar API, but the new toolbar API only shows tooltips preset in the glade file. Not the one set dynamically Anyone know what has to be done differently? I know there was a bug about that a while back, but it was supposed to be fixed. # setup a convienience tuple self.tool_widgets = ["emerge_package1","adv_emerge_package1","unmerge_package1","btn_emerge", "btn_adv_emerge","btn_unmerge", "btn_sync"] self.widget = {} for x in self.tool_widgets: self.widget[x] = self.wtree.get_widget(x) if not self.widget[x]: dprint("MAINWINDOW: __init__(); Failure to obtain widget '%s'" %x) # get an empty tooltip self.synctooltip = gtk.Tooltips() self.sync_tip = _(" Syncronise Package Database \n The last sync was done:\n") self.synctooltip.set_tip(self.widget["btn_sync"], self.sync_tip + self.last_sync) self.synctooltip.enable() -- Brian <[EMAIL PROTECTED]> ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Putting one widget ontop of another
[also posted with minor edits to comp.lang.python] Hello! I'm trying to figure out how to use PYGTK to implement a rudimentary UI: I want to have an Image as the background, and then be able to put buttons (eventually icons, but buttons for now) The PyGTK FAQ (pygtk.org) has some suggestions, but they have failed to clear up the issue. Using their suggestions as a starting point, I've arrived at the below. However, it fails in that I can't seem to place the image behind the button. There is a FAQ entry specifically on this at PyGTK.org, but that fails to show the pixmap (it is obscured completely when we place a button in the Fixed widget), and fails to allow the pixmap to be scrolled. In the next evolution of the program, clicking on the pixmap should place a label/icon/button at that location, so the pixmap needs to be clickable. Can anyone show a minimal example of how I might achieve having the pixmap as the background of the Fixed widget? Thanks Johan def __init__(self): # create the main window, and attach delete_event signal to terminating # the application window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("delete_event", self.close_application) window.connect("destroy", self.close_application) window.set_border_width(0) hbox= gtk.HBox() window.add(hbox) hbox.show() swin1 = gtk.ScrolledWindow() swin1.set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_ALWAYS) swin1.set_size_request(600, 600) hbox.add(swin1) swin1.show() fbox1 = gtk.Fixed() swin1.add_with_viewport(fbox1) fbox1.show() ebox1 = gtk.EventBox() fbox1.put(ebox1,0,0) ebox1.show() image1 = gtk.Image() image1.set_from_file("/home/johan/bg.jpg") ebox1.add(image1) image1.show() widgetinfo( image1) b = gtk.Button("FOO") fbox1.put(b, 200,200) b.show() widgetinfo(b) ebox1.set_events(gtk.gdk.BUTTON_PRESS_MASK) ebox1.connect("button_press_event", self.button_clicked) window.show() ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Treeview speed
Hi all. I'm writting a little tool which contain a Treeview. This Treeview display a liststore that must display each letter with different background color. The result is a slow scrolling. I have already tried set_fixed_height_mode, but did not work. Does anyone here can suggest me something? When the treeview display the same data with the same algorithm without the colors, the speed is completely satisfactory. When I run the program in more powerful computer, the speed became better obviously. But I have 1.3ghz processor and 256 mb RAM memory, and I believe it is enough to the purpose, isn't it? Please, if anyone here knows how to fix it, help me. Sorry for my bad english. Fred _ Chegou o que faltava: MSN Acesso Grátis. Instale Já! http://www.msn.com.br/discador ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/