Re: [pygtk] Need help
That's not an error is just a warning, you have 2 choices: 1) Follow the warning and use gtk.Image() 2) Add in the beginning of you script import warnings warnings.simplefilter('ignore') I suggest you to choose the number 1. On Mon, 2010-08-02 at 20:40 +0300, Cata wrote: > I have this error : > <__main__.ClearlooksStyle object at 0x852b504 (ClearlooksStyle at 0x856b000)> > dec.py:50: DeprecationWarning: use GtkImage > pixmap = gtk.Pixmap(pixmap, mask) > what is wrong ? > > Regards . > > 2010/7/24 Cata : > > I use pygtk to create a class. > > This class has window = gtk.Window(gtk.WINDOW_POPUP) > > I put one image . This image is load from file and show it . > >fixed = gtk.Fixed() > >fixed.put(pixmap, 0, 0) > >window.add(fixed) > >fixed.show() > > All this code is on __init__ > > I have another script this use this class . > > Now i need to change image with new one . > > Basically i need to change like a animated gif ... > > Some ideas ? > > Regards ... > > > > -- > > My sites: > > http://catalin-festila.blogspot.com -about me > > http://tv.free-tutorials.org - video tutorials > > http://python-catalin.blogspot.com - my python blog > > > > > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Set backgound image in frame
Any one had ever try this?, I mean like a frame with some widgets which overlaps the background (the image), basically how do you partially overlap/clobber an Image? I'll appreciate any help. Regards - Joel Rivera ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Custom paper size
Ok, I get it, I was trying to change a predefined size and I didn't know that function. Thank You Dieter. El mié, 03-03-2010 a las 19:49 +0100, Dieter Verfaillie escribió: > Quoting "Joel Juvenal Rivera Rivera" : > > Hello, > > I hope somebody could help me with this... > > > > when I do: > > paper = gtk.PaperSize() > > paper.set_size(216,140,gtk.UNIT_MM) > > > > raise this warning: > > GtkWarning: gtk_paper_size_set_size: assertion `size->is_custom' failed > > > > And the size of the paper remains unchanged. > > You could try the following to create a custom paper size: > >>> paper = gtk.paper_size_new_custom('newcustom', > >>> 'new_custom_papersize', 216, 140, gtk.UNIT_MM) > >>> paper.is_custom() > True > > Regards, > Dieter > > > > This message was sent using IMP, the Internet Messaging Program. > > ___ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Custom paper size
Hello, I hope somebody could help me with this... when I do: paper = gtk.PaperSize() paper.set_size(216,140,gtk.UNIT_MM) raise this warning: GtkWarning: gtk_paper_size_set_size: assertion `size->is_custom' failed And the size of the paper remains unchanged. I'll really appreciate any help. Regards ---Joel Rivera ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Easy way to print on paper?
Hi, I'm trying to print something with the pango layout obtained from the "draw-page" event but i was wondering if it exists something to render simple html like tables and stuff like that to make my life a lot easier, right now I'm trying to measure with tabs and \n, when i just want to print exactly the same as an html table but to a paper. Any suggestions are really appreciated. --Joel Rivera ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] How to render a SpinButton in a TreeView?
Thanks for your answer, I didn't know about that bug, and actually my question was,how to draw the widget i mean static, like a pixbuf, but after reading your code, and some other doc about TreeViews i got the idea it get draws like text, but when you click, it appears the spin button. Regarts, Joel Rivera On Sun, 2009-12-20 at 15:17 +0100, Jiri Bajer wrote: > On Sun, 2009-11-01 at 06:26 +0100, Joel Juvenal Rivera Rivera wrote: > > I hope some one coud help me, i can't draw a spin button in a TreeView, > > im using CellRendererSpin but how do i draw "the widget" not just the > > text o something like that (in the CellRendererText for example). > > I used CellRendererSpin the following way - hope it helps a bit: > > class CellRendererSpinFixed(gtk.CellRendererSpin): > # the whole class is just a workaround for PyGTK bug 492196 > > __gtype_name__ = 'CellRendererSpinFixed' > > def __init__(self): > gtk.CellRendererSpin.__init__(self) > > def do_start_editing(self, event, treeview, path, background_area, > cell_area, flags): > if not self.get_property('editable'): > return > spin = gtk.SpinButton(self.get_property('adjustment')) > spin.connect('editing-done', self._editing_done, path) > spin.connect('key-press-event', self._key_press_event, path) > spin.connect('button-press-event', self._button_press_event) > spin.show() > spin.grab_focus() > return spin > > def _editing_done(self, spin, path): > self.emit('edited', path, spin.get_property('value')) > > def _key_press_event(self, spin, event, path): > if event.type == gtk.gdk.KEY_PRESS: > if gtk.gdk.keyval_name(event.keyval) == 'Up': > spin.spin(gtk.SPIN_STEP_FORWARD) > return True > if gtk.gdk.keyval_name(event.keyval) == 'Down': > spin.spin(gtk.SPIN_STEP_BACKWARD) > return True > > def _button_press_event(self, spin, event): > # avoid unwanted 'editing done' if the user clicks on spin > arrows too > fast, see PyGTK bug 492196 for details > if event.type == gtk.gdk._2BUTTON_PRESS or event.type == > gtk.gdk._3BUTTON_PRESS: > return True # we have already received all the clicks, > throw away > additional signals telling it's double/tripleclick > > --- > > if column_type == 'spin': > adjustment = gtk.Adjustment(lower=args['lower'], > upper=args['upper'], > step_incr=1, page_incr=10) > renderer = CellRendererSpinFixed() # replace with > regular > cellrendererspin when bug 492196 gets finally fixed > renderer.set_property('adjustment', adjustment) > renderer.set_property('editable', True) > renderer.set_property('digits', args['digits']) > renderer.connect('edited', self._spin_update_model, > len(self._model_columns)) > column = gtk.TreeViewColumn(title, renderer, > text=len(self._model_columns)) > column.set_property('expand', False) > column.set_property('reorderable', True) > column.set_property('resizable', True) > if args['digits']: > self._model_columns.append(gobject.TYPE_FLOAT) > else: > self._model_columns.append(gobject.TYPE_INT) > self._view_columns.append(column) > return > --- > > def _spin_update_model(self, renderer, path, new_text, column): > """ > Updates the model whenever the spin value changes. > """ > digits = renderer.get_property('digits') > if digits > 0: > try: > new_value = float(new_text) > except: > return > (integral, decimal) = new_text.split('.') > new_text = integral + '.' + decimal[0:digits] > new_value = float(new_text) > else: > try: > new_value = int(float(new_text)) # direct > conversion of float-string > to int raises an error > except: > return > > self.model[self.sortable_model.convert_path_to_child_path(path)][column] > = new_value > > --- > > > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] How to render a SpinButton in a TreeView?
I hope some one coud help me, i can't draw a spin button in a TreeView, im using CellRendererSpin but how do i draw "the widget" not just the text o something like that (in the CellRendererText for example). ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/