Re: [pygtk] drawing and modifying svg file

2008-09-10 Thread JustFillBug
On 2008-09-09, Fran?ois Sénéquier <[EMAIL PROTECTED]> wrote:
>
> I would load and SVG file (XML file so a text file), modify it
> (changing a color, moving a part...) by the DOM/XML interface (or
> directly adding or replacing text) and create again an gtk.gdk.pixbuf
> without creating another SVG file. 
>
> So the solution could be to load the text file, modify it and create a
> new pixbuf from the loaded modified text (not the file)... 
>
> But with the gtk.gdk.pixbuf it is possible to create a pixbuf from a
> file but it seems to be impossible to create a pixbuf from a SVG
> string variable ?
>
> I don't want to create several svg files but modifying dynamically the
> content of an unique svg file (after loaded it) and then draw it.
>

Use PixbufLoader('svg')

def svg_str_to_pixbuf(txt):
'''Load pixbuf from a svg str.'''
pl = gtk.gdk.PixbufLoader('svg')
pl.write(txt)
pl.close()
pix = pl.get_pixbuf()
return pix

___
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] Re: help fixing max/minimum size of a widgets

2008-07-09 Thread JustFillBug
On 2008-01-07, Steven Howe <[EMAIL PROTECTED]> wrote:
>
> My situation:
> I have a gtk.HBox with three widgets, a gtk.Progressbar, a 
> gtk.HSeperator and a gtk.Statusbar in the gtk.HBox. I would like the 
> gtk.Progressbar and gtk.Statusbar to have minimum fixed widths and fixed 
> heights, similar to what one expects from a Menu. I've tried 
> "gtk.Widget.set_size_request", which set the minimum size width and 
> height very nicely. Now how do I fix the height i.e. maximum = minimum ?
>

You don't set the size of the widget. When you add the widget to the
hbox, you set the set expand=False:

hbox.pack_start(progressbar, expand=False)


___
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] Re: 'live search' ComboBoxEntry

2008-07-09 Thread JustFillBug
On 2008-01-06, John Pye <[EMAIL PROTECTED]> wrote:
>
> but so far it doesn't work as I would like: when the combobox pops up,
> the keyboard focus is taken away from the Entry, which means it's rather
> cumbersome to use.
>
> Is this something that can be acheived with the standard ComboBoxEntry?
> Has anyone got some same code for this sort of thing?
>

just has the entry.grab_focus() after you popupped the combobox.

___
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] Re: adjust height of textview

2008-07-09 Thread JustFillBug
On 2007-09-13, Vincent Schut <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> anyone knows how to change the (default) height of a textview? It seems
> to default to something like 5 or 6 lines, and I can't seem to get it
> shrink. I'd like it to have a height of 3 or 4 lines max, but have no
> idea how to accomplish that... (I've searched the net to no avail).
>

You have to put it in a scrolledwindow and set a wrap mode.

___
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/