Re: [pygtk] gobject.idle_add, timeout_add gdk-thread-safe?

2013-12-01 Thread Tim Evans
return gobject.idle_add(_callback_wrapper, func, *args, **kw) def timeout_add_lock(milliseconds, func, *args, **kw): return gobject.timeout_add(milliseconds, _callback_wrapper, func, *args, **kw) -- Tim Evans

Re: [pygtk] PyGTK and gdk_input_add

2013-11-12 Thread Tim Evans
also gets everything nice and serialised into one thread, making race conditions easier to avoid. Note that you should avoid interacting with the UI directly from the background thread on Windows, as it will cause a lock up. It's generally better to avoid it on non-Windows pla

Re: [pygtk] Receive events without focus

2013-06-03 Thread Tim Evans
verride. You might look at how AutoHotkey (http://www.autohotkey.com/) does it, or consider just using AutoHotkey to send the right keys to your app. -- Tim Evans ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygt

Re: [pygtk] gtk.Window act as gtk.Dialog

2011-07-19 Thread Tim Evans
window afterwards, after pulling any information you need from the widgets within the window. -- Tim Evans Senior Software Engineer ARANZ Geo Limited p: +64 3 374 6120 | e: t.ev...@aranz.com www.aranzgeo.com from __future__ import division import gtk, gobject class RunAsDialog(object):

Re: [pygtk] floating point precision

2011-03-08 Thread Tim Evans
be sortable by number? Use gtk.TreeViewColumn.set_sort_column_id to point the sorting at the float column in the model. This is where the separation between view columns and model columns comes in handy. -- Tim Evans ___ pygtk mailing list pygtk@daa.com

Re: [pygtk] floating point precision

2011-03-07 Thread Tim Evans
d([MYFLOAT, round(MYFLOAT, 2)]) win.add(treeview) win.show_all() gtk.main() Make the second column a string, and add the formatted value to it. If you want two decimal places, use '%.2f' % MYFLOAT. -- Tim Evans ___ pygtk mailing list pygtk@daa.c

Re: [pygtk] ... and nothing appears

2011-02-02 Thread Tim Evans
for stacking widgets in a scrolled area? Looks like you're just missing a "label.show()" call in there. -- Tim Evans Senior Software Engineer ARANZ Geo Limited p: +64 3 374 6120 | e: t.ev...@aranz.com Level 6, 227 Cambridge Terrace, PO Box 3894, Christchurch, New Zealand www.aran

Re: [pygtk] ComboBox Unresponsive with Custom CellRenderer

2010-12-27 Thread Tim Evans
ways the case when threads are involved. -- Tim Evans Senior Software Engineer ARANZ Geo Limited p: +64 3 374 6120 | e: t.ev...@aranz.com www.aranzgeo.com ___ 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] Problem with gtk.TextView in Windows, but not in Linux

2010-12-12 Thread Tim Evans
x27;t work properly, Courier New is the truetype version. You could also use the font name "monospace" which will default to a useful monospaced font. I'm not sure what the standard GTK+ install uses but it should be Consolas where available (Vista and 7 for sure) falling back t

Re: [pygtk] comboboxes and images

2010-08-22 Thread Tim Evans
efile = '../../data/' + service + '.png' image = gtk.Image() image.set_from_file(imagefile) pixbuf = image.get_pixbuf() The better way to load a pixbuf from a file is: pixbuf = gtk.gdk.pixbuf_new_from_file(imagefile) -- Tim Evans

Re: [pygtk] funkiness with gtk constants and CellRendererPixbuf

2010-08-18 Thread Tim Evans
of the list model. If you just want to set a constant value for a cell renderer property, use something like this: render_pixbuf.props.stock_size = gtk.ICON_SIZE_BUTTON -- Tim Evans ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.

Re: [pygtk] gtk.gdk.Pixbuf troubles and IRC

2010-07-21 Thread Tim Evans
our of composite when sampling an area larger than the scaled source to be a minor bug. It can be worked around pretty easily, but I can't imagine any situation where the current behaviour would be useful. As you've demonstrated it can be higher counter-intuitive. -- Tim Evans Appl

Re: [pygtk] gtk.gdk.Pixbuf troubles and IRC

2010-07-20 Thread Tim Evans
rge, 5, 5, 20, 20, 5, 5, 1, 1, 'nearest', 255) small.composite(large, 10, 10, 20, 20, 10, 10, 1, 1, 'nearest', 255) large.save('test.png', 'png') -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] push huge array into liststore

2010-07-12 Thread Tim Evans
gtk.TreeViewColumn.set_fixed_width gtk.TreeView.set_fixed_height_mode - If your list is large enough it may be worth subclassing gtk.TreeModel and overriding the required methods. It's complex, but it can avoid referencing all your data at tree build time, instead loa

Re: [pygtk] gtk.gdk.Pixbuf troubles and IRC

2010-07-11 Thread Tim Evans
e arguments are a bit complex and I'd be sure to get them wrong the first time and confuse you. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] idle_add vs. threads_enter/threads_leave

2010-07-06 Thread Tim Evans
On 2010-07-07 13:26, Jason Heeris wrote: > Tim Evans wrote: >> GTK+ 2.14.4 >> PyGObject 2.14.2 >> PyGTK 2.12.1 > > Mine is > > GTK+ 2.20 > PyGObject 2.21.2 > PyGTK 2.17.1 > > A few things about your changes confused me - > > 1. You call glib.i

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Tim Evans
: try: func(*args) return False finally: event.set() gobject.idle_add(idle) event.wait() -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] Threading Question

2010-06-28 Thread Tim Evans
read. > Still getting my head around threads. See all sorts of references all of > which seem a wee bit beyond my comprehension at the moment. Any comments > would be appreciated. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/

Re: [pygtk] Updating a window

2010-06-22 Thread Tim Evans
rking and I'll have a look at it. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] gtk.ActionGroup.add_actions and user_data

2010-03-28 Thread Tim Evans
possible to > define different user_data for callbacks? You could construct each callback with functools.partial. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/list

Re: [pygtk] gtk.gtk.PixBuf to OpenGL texture?

2010-01-31 Thread Tim Evans
ng and allocating big blocks of video memory, instead copying data into the same block each time. - Use a "Pixel Buffer Object" to move data into the texture instead. You'll need the "ARB_pixel_buffer_object" extension. This pages has

Re: [pygtk] Reduce text_entry width

2010-01-27 Thread Tim Evans
so set in manually with this line of code: my_entry.props.width_chars = 5 -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] Popup always on top of everything

2009-11-18 Thread Tim Evans
ip-taskbar-hint", True) This looks much more sensible actually. Making changes to the GtkWindow/GtkWidget and letting Gtk itself handle setting up the GdkWindow tends to be the better option when it is possible. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___

Re: [pygtk] Popup always on top of everything

2009-11-17 Thread Tim Evans
lize', configure_balloon, self[PropertyDialogView.top]) Again, this seems to work on win32, and while I think it's more likely to work on Linux it's not guaranteed. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___

Re: [pygtk] Popup always on top of everything

2009-11-16 Thread Tim Evans
opup, w) This should, at least on win32 where I tested it, give you a popup window that stays above the specific parent window rather than everything. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.

Re: [pygtk] how to cut off the maximum button in the window?

2009-10-12 Thread Tim Evans
storing that size next time your software runs is also a good idea. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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 cut off the maximum button in the window?

2009-10-11 Thread Tim Evans
Note that you need to wait for the GtkWindow to be realized before you can access its GdkWindow. Handling the 'realize' signal is the normal way to do that, so code often ends up looking like this: def on_realize_set_decor(window, decor): window.window.set_decorations(decor)

Re: [pygtk] A "delayed changed" signal for text entries?

2009-09-29 Thread Tim Evans
False Call 'call()' whenever the entry changes. Your callback will be called when nothing has happened in the last 'delay' milliseconds. You may need something to force an early check on focus-out-event for the entry or when the user clicks an "Ok" b

Re: [pygtk] TreeView header

2009-09-10 Thread Tim Evans
lumn(n)" to get the object if you don't already have it, then "c.set_alignment(0.5)" to centre the text in it. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] set_use_markup and gtk.SpinButton

2009-08-10 Thread Tim Evans
you shouldn't modify the returned layout. I think it would be better to use: spin.modify_font(pango.FontDescription('10')) You also don't need to specofy 'normal', '10' is a font description. -- Tim Evans Applied Research Associates NZ http://www.

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Tim Evans
to render the column header. Your button-press-event connection will work on that widget, provided you make headers clickable on the treeview: treeview.set_headers_clickable(True) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/

Re: [pygtk] How can I Load HTML file that contain css (in windows OS)

2009-06-01 Thread Tim Evans
orry if this is a stupid suggestion, but have you thought about loading the HTML file in a web browser? import webbrowser webbrowser.open('file://path/to/file') Personally I much prefer viewing help or similar things in a real web browser where I can bookmark, search, etc. t

Re: [pygtk] changing the foreground colour of entry box dynamically

2009-04-08 Thread Tim Evans
Tim Evans wrote: > ganesh gajare wrote: >> Hello, >> I have created an entry box widget using glade. >> and I am doing validation on that field... >> So whenever an invalid text is entered in the entry box,the text color >> of entry should change dynamically.

Re: [pygtk] changing the foreground colour of entry box dynamically

2009-04-08 Thread Tim Evans
method 'modify_text' should do what you need. For example, to set the text to red, use: entry.modify_text(gtk.gdk.color_parse('red')) and to set it back to the default black: entry.modify_text(None) -- Tim Evans Applied Res

Re: [pygtk] File doesn't get closed: how to make sure that the object is 'freed'?

2009-03-15 Thread Tim Evans
> The source code for python-poppler can be found here: > > http://bazaar.launchpad.net/~poppler-python/poppler-python/trunk/files > > I didn't write the wrapper, but if someone can help me fixing it I > would be very happy! Try running

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-08 Thread Tim Evans
s to happen in PyGTK, including actual window operations I think. Our app crashes without this hack, and previous versions would lock up. I haven't had time to properly investigate the cause. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ __

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-08 Thread Tim Evans
gc.disable() def collect(): with gtk.gdk.lock: gc.collect() return True gobject.timeout_add_seconds(10, collect) Not a long-term solution, but it gets your software working. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ 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] Cairo Line Width

2008-09-25 Thread Tim Evans
10) only half of that 1-pixel is in the 10th row, the other half being in the 9th row. Cairo renders this by antialiasing, so you get a 2-pixel side 50% gray line rather than the 1-pixel black line you were expecting. -- Tim Evans Applied Research Associates NZ

Re: [pygtk] treeview markup entries and interactive search

2008-08-20 Thread Tim Evans
Tasos Latsas wrote: > I tried it but unfortunately the normal and bold entries are in the same > column, so I need the tags...:( Looks like I'll use the extra-column > solution.. > Thanx anyway!! > > Tim Evans wrote: >> gtk.CellRendererText has separate properties fo

Re: [pygtk] treeview markup entries and interactive search

2008-08-19 Thread Tim Evans
you describe you would set the "weight" property to pango.WEIGHT_BOLD and just use "text" rather than "markup". Unless you need to change the font attributes mid-way through the text using the specific attributes will be a little faster than markup and won't

Re: [pygtk] Formatting a spinbutton's display

2008-07-29 Thread Tim Evans
function, and once I had that I could use ctypes to set the double it points to. Attached an ugly hack that solves your problem. Thanks for posting btw, this was fun ;) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ import gtk, ctypes def _currency_input(spinbutton, gpoint

Re: [pygtk] Let's split it up...

2008-07-01 Thread Tim Evans
" the nothing will happen when you click the button. Put whatever code you want into that method. The normal clicked behaviour of gtk.CheckButton can be triggered by calling the superclass method "gtk.CheckButton.do_clicked(self)" from within your method. -- Tim Evans Applie

Re: [pygtk] reparent problem

2008-06-29 Thread Tim Evans
e_widget(dummyWidget, self.shootingArea)" and wherever dummyWidget was (and with whatever packing properties) your shootingArea widget will be put there instead. You could add more copying of properties is you need it, this function only copies visibility. -- Tim Evans Applied

Re: [pygtk] How to make a browser?

2008-06-16 Thread Tim Evans
ser's preferred browser: import webbrowser webbrowser.open('http://www.python.org/') -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/

Re: [pygtk] Trouble getting a ListStore with dynamic column number.

2008-01-31 Thread Tim Evans
containing one 'str' type and repeats the list 10 times. The second line uses the python "*args" syntax to expand the list into a list of arguments. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk

Re: [pygtk] create a gtk.Button without any label

2007-11-26 Thread Tim Evans
mage, text = hboxtemp.get_children() text.set_text(' ') Is there a more simple solution ? image = gtk.Image() image.set_from_stock(gtk.STOCK_SAVE, gtk.ICON_SIZE_BUTTON) button = gtk.Button() button.add(image) image.show() I would consider this to be the correct way to do it. -- Tim Ev

Re: [pygtk] strange spinbutton behavior

2007-06-27 Thread Tim Evans
sing threading, but for an action that can take several seconds you should probably look at using them. -- Tim Evans Applied Research Associates NZ http://www.aranz.co.nz/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/

Re: [pygtk] image and text in button

2007-01-22 Thread Tim Evans
for GTK disables button images to make it look more like windows. This might be what's breaking your button. You could try changing the 'gtkrc' file associated with the ms-windows theme to remove the line "gtk-button-images = 0". -- Tim Evans Applied Re

Re: [pygtk] image manipulation

2006-09-10 Thread Tim Evans
don't lide the looks of this loop.. :-) ) This will work; I'd just recommend using descriptive variable names to make it more obvious: for row in matrix: for pixel in row: pixel[0] = color_red pixel[1] = color_green pixel[2] = color_blue -- Tim Evans A

Re: [pygtk] gtk.glade missing a get_custom_handler function

2006-06-18 Thread Tim Evans
ler = _CustomHandlerStack() And use it later like this: custom_handler.push(my_hander_func) x = gtk.glade.XML(...) custom_handler.pop() -- Tim Evans Applied Research Associates NZ http://www.aranz.co.nz/ ___ pygtk mailing list pygtk@daa.com

Re: [pygtk] Help with pygtk save_to_callback

2006-04-17 Thread Tim Evans
n memory buffer that stores the image in the given file type? Untested, but maybe something like this, where 'p' is a pixbuf: import cStringIO as StringIO io = StringIO.StringIO() p.save_to_callback(io.write, 'png') buffer = io.getvalue() -- Tim Evans

Re: [pygtk] dialogs, sys.excepthook and gobject.add_idle

2006-04-17 Thread Tim Evans
return gobject.idle_add(_with_lock, func, args) def timeout_add_lock(millisecs, func, *args): return gobject.timeout_add(millisecs, _with_lock, func, args) -- Tim Evans Applied Research Associates NZ http://www.aranz.co.nz/ ___ pygtk mailing list pygtk@

Re: [pygtk] Ok. A new try...

2006-03-23 Thread Tim Evans
ry if you'll be doing these lookups often: def named_widgets(root): r = {} for w in all_descendants(root): name = w.get_name() if name: r[name] = w return r -- Tim Evans Applied Research Associates NZ http://www.aranz.co.nz/ __

Re: [pygtk] Cell background in a TreeView

2005-11-16 Thread Tim Evans
win.add(tree) win.connect('delete-event',lambda x,y:gtk.main_quit()) win.show_all() gtk.main() Try setting the property "cell-background-gdk" rather than "background-gdk". GtkCellRendererText::background-gdk colours the background of the text, and excludes border

Re: [pygtk] calling a program from a program

2005-11-14 Thread Tim Evans
the SIGCHLD signal, but this would be more complex and not portable to Windows. I'll leave it as an exercise for the reader :) -- Tim Evans Applied Research Associates NZ http://www.aranz.co.nz/ ___ 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/

Re: [pygtk] FAQ Entry 20.6 looks wrong to me.

2005-06-22 Thread Tim Evans
e_ui(self, data): gtk.threads_enter() try: #perform ui updating here return False finally: gtk.threads_leave() -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list p

Re: [pygtk] GdkPixdata in PyGTK?

2005-06-15 Thread Tim Evans
a: array[y,x,:] = (r, g, b, 255) pixbuf = gtk.gdk.pixbuf_new_from_array(array, gtk.gdk.COLORSPACE_RGB, 8) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.com.au http://

Re: [pygtk] threads and win32 gtk

2005-05-12 Thread Tim Evans
should call: do_gui_operation(add_image_to_list, list, image) You don't need to hold the thread lock to call gobject.idle_add (or do_gui_operation) but you do need to acquire it inside the idle function because they are, by default, run without holding the thread lock. -- Tim Evans Applied Rese

Re: [pygtk] 2.4.2 release

2005-03-17 Thread Tim Evans
;m using PyGTK 2.4.1 with a patched pygobject.h and version of Python 2.4 that I compiled using MSVC 6 and it works fine for me. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com

Re: [pygtk] Threading on win32

2005-02-27 Thread Tim Evans
w): gobject.idle_add(in_idle, args, kw) return wrapper @idlefunction def show_message(message): w = gtk.Window() w.add(gtk.Label(message)) w.show_all() -- Tim Evans Applied Research Associates NZ http://www.aranz.com/

Re: [pygtk] Forbid focusing of TreeView columns

2005-02-22 Thread Tim Evans
arent() w.set_property("can-focus", False) Note how I also add a mnemonic to the new label widget so that the column header is still accessible from the keyboard. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygt

Re: [pygtk] FW: Gtk / PyGtk crashing python interpreter

2005-02-03 Thread Tim Evans
e a problem when 2.6 is released. If you want it fixed now the you could apply the attached patch and recompile. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/

Re: [pygtk] trouble with pixbuf's

2005-01-24 Thread Tim Evans
given by p.get_rowstride(). Where 'p' is a pixbuf, the number of bytes per pixel is 'p.get_n_channels()', and row 'i' starts at byte 'i * p.get_rowstride()'. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ __

Re: [pygtk] pygtk and threads.

2005-01-23 Thread Tim Evans
_idle_func(function, args, kw): gtk.threads_enter() try: return function(*args, **kw) finally: gtk.threads_leave() def idle_add_lock(function, *args, **kw): gobject.idle_add(_idle_func, function, args, kw) -- Tim Evans Applied Research Asso

Re: [pygtk] ANNOUNCE: PyGTK 2.5.2 released (unstable)

2005-01-10 Thread Tim Evans
Johan Dahlin wrote: I just put up a tarball of PyGTK 2.5.2 on ftp.gnome.org, it can be fetched from: ftp://ftp.gnome.org/pub/GNOME/sources/gnome-python/2.5/ once the mirrors have synced correctly. I think that URL should have been: ftp://ftp.gnome.org/pub/GNOME/sources/pygtk/2.5/ -- Tim Evans

Re: [pygtk] Toolbar and icon sizes

2004-12-09 Thread Tim Evans
the set_icon_size method of Toolbar. You can set the global toolbar icon size using GtkSettings. Look at the documentation for gtk_settings_get_default and the GtkSettings property 'gtk-toolbar-icon-size'. You, or your users, can also set this via configuration files. -- Tim Eva

Re: [pygtk] GenericCellRenderer shows text vertically

2004-11-21 Thread Tim Evans
ation shows that the wrap width passed here should be in pango units, not pixels. One pixel is pango.SCALE pango units, so the line should be: layout.set_width(cell_area.width * pango.scale) -- Tim Evans Applied Research Associates NZ http://www.aran

Re: [pygtk] Problem with notebook page switching in Windows thread

2004-11-07 Thread Tim Evans
lse finally: gtk.threads_leave() def in_main_thread(func, *args, **kw): gtk.idle_add(_in_main_thread_idle, func, args, kw) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED]

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Tim Evans
. I think that all of this should go into a module called 'glog'. If anyone else likes this idea I could try putting together an initial version of such a module. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pyg

Re: [pygtk] problems with gtk.Statusbar()

2004-05-30 Thread Tim Evans
t into the statusbar. pixbuf = gtk.gdk.pixbuf_new_from_file('figure.xpm') image = gtk.Image() image.set_from_pixbuf(pixbuf) statusbar.pack_start(image) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [E

Re: [pygtk] Non-Themed Icons in TreeView...

2004-05-04 Thread Tim Evans
use the "stock-id" and "stock-size" properties of gtk.CellRendererPixbuf rather than setting the "pixbuf" property directly. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL

Re: [pygtk] Python in GNOME Platform Bindings 2.7/2.8?

2004-02-17 Thread Tim Evans
ts of experience in writing Python extensions by hand, so I'd be happy to write overrides for functions that are too complex to wrap automatically. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED

Re: [pygtk] save pixbuf to stdout

2004-02-11 Thread Tim Evans
()ing to it.. Producing a string from a pixbuf (in PNG format) is coverred here: http://bugzilla.gnome.org/show_bug.cgi?id=82203 This patch will be part of GTK+-2.4. Until then the only way to get a pixbuf in a string is to use a temporary file. -- Tim Evans Applied Research Associate

Re: [pygtk] pyGTK on Windows

2004-02-09 Thread Tim Evans
called by the main thread? Under Windows, if you don't call gtk.threads_init() then GTK will never release the Python GIL (Global Interpreter Lock). This will mean that other Python threads will hardly ever get a chance to run, and your program will run slowly. -- Tim Evans Applied Re

Re: [pygtk] pyGTK on Windows

2004-02-08 Thread Tim Evans
function if you are doing any GUI stuff in it. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Re: [pygtk] what is the fastestest way to load and display from a PIL image ?

2004-01-12 Thread Tim Evans
ape = (w, h, -1) p = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, i.mode == 'RGBA', 8, w, h) p.pixel_array[:] = data -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/m

Re: [pygtk] thread support on windows ?

2004-01-05 Thread Tim Evans
lex if you aren't careful. Use Python's 'Queue' module for everything; if your algorithm requires something more complicated than Queue then change your algorithm ;-) -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ __

Re: [pygtk] Zoom in the image

2004-01-04 Thread Tim Evans
[EMAIL PROTECTED] wrote: I need make zoomin and zoomout in one image using pygtk. Take a look at the documentation for the Gdk-Pixbuf library: http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/index.html -- Tim Evans Applied Research Associates NZ http://www.aranz.com

Re: [pygtk] TreeView, Windows Look & Feel

2004-01-04 Thread Tim Evans
[-] expanders. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Re: [pygtk] Changing mouse cursor on TextView

2003-12-09 Thread Tim Evans
. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Re: [pygtk] anti aliased fonts win32

2003-11-18 Thread Tim Evans
to smooth edges of screen fonts" and select "ClearType" from the combo box. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/

Re: [pygtk] pyGtk/C extension

2003-11-05 Thread Tim Evans
tp://www-106.ibm.com/developerworks/linux/library/l-wrap/ Looking at the source for pygtk is also a good source of information, but it's rather complex. You will need to download the source anyway to get the codegen package. -- Tim Evans Applied Research Associate

Re: [pygtk] pyGtk/C extension

2003-11-05 Thread Tim Evans
return NULL; widget = GTK_WIDGET(py_widget->obj); You might also want to look at the 'codegen' stuff that pygtk uses to automatically generate most of the pygtk interface. Once you get used to using it, it's much easier to use than writing everything by hand. -- Tim Evans

Re: [pygtk] Making my own widget in Pygthon - Some more info

2003-09-24 Thread Tim Evans
reference counts when you started doing stuff like that 'connect' call above. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

[pygtk] sys.excepthook and the gtk thread lock

2003-09-11 Thread Tim Evans
was recursive? GDK_THREADS_ENTER is a macro, so I don't think that the lock could be changed from a GMutex to a GStaticRecMutex without breaking binary compatibility. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ pygtk m

Re: [pygtk] CVS branches and plans for the future.

2003-09-07 Thread Tim Evans
adding METH_CLASS to the flags in the PyMethodDef array (with METH_VARARGS and METH_KEYWORDS). This would make it possible to change from: p = gtk.gdk.pixbuf_new_from_file(...) to: p = gtk.gdk.Pixbuf.new_from_file(...) -- Tim Evans Applied Research Associates NZ http://www.aranz.com

Re: [pygtk] Getting text entry to print

2003-08-15 Thread Tim Evans
string (the current contents of the entry). What you need to do is pass the entry widget itself: self.printButton.connect('clickec', self.printIt, entry) And the inside 'printIt' call the get_text method. I have attached a fixed and cleaned up version of your code.

Re: [pygtk] converting an Numeric array to a Pixbuf

2003-07-31 Thread Tim Evans
Tim Evans wrote: > [snip] I'm not sure about 1.99.14, but 1.99.16 can be compiled with Numeric support. If it is you can create a Pixbuf by modifying the array returned be accessing the 'pixel_array' attribute of an existing pixbuf. Assuming that you have a (n,m,3) or (n,m

Re: [pygtk] converting an Numeric array to a Pixbuf

2003-07-31 Thread Tim Evans
x27;pixel_array' attribute is read-only in that you can't do 'p.pixel_array = data'. But it's not immutable, so you can still change it's contents, which is what the [:] slice assignment does. The reference could probably make this more clear. -- Tim Evans Applie

Re: [pygtk] converting an Numeric array to a Pixbuf

2003-07-29 Thread Tim Evans
xbuf. Assuming that you have a (n,m,3) or (n,m,4) shape 'b' type array of RGB or RGBA values called 'data', you would do this: w,h = data.shape[:2] hasalpha = shape.shape[3] == 4 p = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, hasalpha, 8, w, h) p.pixel_array[:] = data -- Tim E