Re: [pygtk] How to pass the value to a function? (gtk.entry)

2014-04-25 Thread Hrvoje Niksic
On 04/25/2014 07:18 AM, bakabonpapa wrote: Right now, I'm building a gui program using pygtk. And there is an entry box using gtk.Entry and its get_text. I'v been trying to pass its parameter to a function as a parameter, but strugling for long hours without succsess. Please describe what you

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

2013-12-02 Thread Hrvoje Niksic
On 12/01/2013 10:19 PM, Tim Evans wrote: It's the GTK and GDK functions you have to be careful with. You don't need (3)/(4). You should still have (1)/(2), Why? I thought the whole point of using g_idle_add from the other thread is to have the callbacks invoked in the GUI thread (the thread

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

2013-12-02 Thread Hrvoje Niksic
On 12/02/2013 09:50 AM, Dan wrote: Also, related to Hrvoje Niksic's comment, is it safe to use GDK calls from other threads at all (as long as you guard them with the appropriate incantations)? Or do you absolutely have to schedule all GUI work to the GUI thread? According to

Re: [pygtk] Help installing PyGObject

2013-03-12 Thread Hrvoje Niksic
On 03/05/2013 09:20 PM, Vincent D. Brown wrote: I was wondering if anyone could help me with some installation trouble. I downloaded PyGObject 3.0.2 and tried running configure. It said that I don't have glib version = 2.24.0, so I found glib 2.24.2 and installed it. The configure still stops

Re: [pygtk] pygobject_new segfault

2012-05-21 Thread Hrvoje Niksic
You need to call pygobject_init(-1, -1, -1) before using pygobject. You also need to call Py_Initialize(). Also, since you're using gtk, and not just gdk, you should call gtk_init(). With the first three lines of main() changed to: gdk_init(argc, argv); Py_Initialize();

Re: [pygtk] PyGTK object escapes garbage collection

2010-12-24 Thread Hrvoje Niksic
The problem you describe sounds like it might be related to this infamous PyGTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=546802 In our tests the problems show up when a Python object that participates in a cycle is referenced only through a GTK widget. When GC takes place, Python's

Re: [pygtk] libglade bug?

2009-05-04 Thread Hrvoje Niksic
Rob Brown-Bayliss wrote: print = print Count = + str(self.check_count) self.check_count += 1 print self.wtree.get_widget(label_checkbutton) print = if self.wtree.get_widget(label_checkbutton).get_active():

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

2009-03-06 Thread Hrvoje Niksic
Margarita Manterola wrote: I probably screwd up, because it didn't work. This is what I was left with: My code was not meant to be run verbatim, sorry I didn't make that clearer. For example, PyImport_Import takes a PyObject * argument, not a C string, use PyImport_ImportModule instead.

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

2009-03-05 Thread Hrvoje Niksic
Margarita Manterola wrote: The garbage collector is called while the code is in the for loop, it removes one of the toplevel windows which is not in use anywhere, except that it's already on the list, thus after the GC returns and the loop tries to access that removed window, it triggers a

Re: [pygtk] Signal handling

2000-06-05 Thread Hrvoje Niksic
"Luca Minuti" [EMAIL PROTECTED] writes: #!/usr/bin/env python from signal import * from gtk import * def signal_handler(sig, frame): print "Received signal %s" % (sig) signal(10, signal_handler) win = GtkWindow() win.set_usize(100,100) win.show() win.connect("destroy",

Re: [pygtk] Signal handling

2000-06-05 Thread Hrvoje Niksic
"Luca Minuti" [EMAIL PROTECTED] writes: I think that the use of the signal is not the only possible solution for me. But I don't know others inter process comunication tecnique. My program must do this: if someone make some change to the data that the program manipulate other instance of

Re: [pygtk] PyQt/PyKDE Bindings

2000-03-23 Thread Hrvoje Niksic
François Pinard [EMAIL PROTECTED] writes: Moshe Zadka [EMAIL PROTECTED] writes: As long as you're breaking things anyway, let me suggest one change: have the "Gtk" prefix stripped from the classes' names (GtkText - Text, etc) [...] For one, I would be happy to make that change, as

Re: [pygtk] Anti-aliasing ?

2000-03-14 Thread Hrvoje Niksic
Torsten Landschoff [EMAIL PROTECTED] writes: On Mon, Mar 13, 2000 at 02:05:39PM +0100, Hrvoje Niksic wrote: What version of gnome-python do you have installed on your system? 1.0.50-3 (Debian). Hmm, does anybody know if this feature is needed by a lot of programs? I have no idea

Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic
James Henstridge [EMAIL PROTECTED] writes: What version of gnome-python do you have installed on your system? 1.0.50-3 (Debian). To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Re: [pygtk] Hello, and `pygtk' reminder

2000-02-15 Thread Hrvoje Niksic
François Pinard [EMAIL PROTECTED] writes: I suppose I should put in a message stating that the pyglade module is deprecated. It is probably better to use the libglade module, which uses libglade rather than being pure python. It handles the default_width and default_height

[pygtk] Threads with Gtk?

1999-11-16 Thread Hrvoje Niksic
What is the current level of support for threading in PyGTK? Last time I checked, threading had problems because threads weren't enabled upon entrance to main loop, and in several other places. Specifically, how does Gtk's threading model mesh with Python's threading? Is it possible for the

Re: [pygtk] Panel applet taking button2

1999-11-02 Thread Hrvoje Niksic
[ Please note that button2 is the *middle* button, not the right mouse button. Your question seems to imply that you think I want to change the behaviour of right-click, which I don't. ] Edward Muller [EMAIL PROTECTED] writes: 1) What do you want to do on the button 2 click? I'm writing

[pygtk] Retrieving selection data

1999-11-01 Thread Hrvoje Niksic
How do I retrieve the current X selection in pygtk? I'd like to, say, have it as a Python string, or as None if none is available. I've looked at the Gtk tutorial, but in this case, wasn't at all obvious how to convert the C code to Python. To unsubscribe: echo "unsubscribe" | mail [EMAIL

[pygtk] Panel applet taking button2

1999-11-01 Thread Hrvoje Niksic
Is there a way for a panel applet to have control of button2 clicks. Normally, when button2 is pressed, the applet is moved. However, I *really* want my applet to respond to button2 clicks. Any ideas? To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Re: [pygtk] Ruler in vbox doesn't work

1999-10-31 Thread Hrvoje Niksic
Deirdre Saoirse [EMAIL PROTECTED] writes: #include rant on C code not being able to have abstract \ non-instantiable classes But we're using Python, aren't we? :-) I think the following check in "abstract" classes' __init__() would work: assert self.__class__ != GtkRuler James, what

Re: [pygtk] GtkTreeItem boggle

1999-10-09 Thread Hrvoje Niksic
James Henstridge [EMAIL PROTECTED] writes: Now in order to have the same python object refer to a particular gtk object all the time, the gtk object would need to hold a reference to it (we don't want the python object to be freed while the gtk object is in use). This forms a circular

Re: [pygtk] Hooking into Gtk iterations

1999-02-25 Thread Hrvoje Niksic
James Henstridge [EMAIL PROTECTED] writes: As for doing a python no op, I have no idea how python triggers the calling of signal handlers The signal handlers are queued up somewhere; Python will empty the queue as soon as it gets the chance -- I'm certain of that. A no-op would be quite

Re: [pygtk] Hooking into Gtk iterations

1999-02-25 Thread Hrvoje Niksic
Aaron Optimizer Digulla [EMAIL PROTECTED] writes: The only solution I see is to add a timer: def wakeup: pass timeout_add (100, wakeup) I know of this solution and I will not use it, because it disallows my program from ever being swapped out -- it continually consumes CPU

[pygtk] 1:1 mapping between C and Python objects

1999-02-23 Thread Hrvoje Niksic
I thought about this some more, and then returned to an earlier message of James'. I think I spotted a flaw in James' logic. Here is the excerpt: I looked at this a bit, but it is a little difficult. First of all, you want these two things to occur: - The C level GtkObject

Re: [pygtk] Popup menus

1999-02-19 Thread Hrvoje Niksic
Silence here is worrysome. Is it possible that noone has needed popup menus in PyGtk before? Or, is there an FAQ or a FM that I should read? To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Re: [pygtk] Popup menus

1999-02-19 Thread Hrvoje Niksic
Thanks, this works like a charm. Note that there is still a bug when you attempt to actually use a function, whatever it's supposed to do. Test by supplying a dummy function; I get: SystemError: new style getargs format but argument is not a tuple It looks like a bug in gtkmodule. To

Re: [pygtk] New snapshot of pygtk

1999-02-19 Thread Hrvoje Niksic
James Henstridge [EMAIL PROTECTED] writes: I am not sure how to handle this problem. Does anyone have any ideas? Can you please try to recapitulate what exactly the problem is? I find it sort of hard to follow. To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

[pygtk] Selections in pygtk?

1999-01-03 Thread Hrvoje Niksic
I'm stuck with this, and I'd really appreciate some help. I simply don't understand how to get the current X selection in pygtk. I don't understand the proper arguments to selection_convert(), and there seem to be no examples which I could copy. Is it possible that noone has need of this in

Re: [pygtk] Panel applet taking button2

1999-01-02 Thread Hrvoje Niksic
James Henstridge [EMAIL PROTECTED] writes: The deskguide applet has a special action for the middle button. Maybe you could look at that code. Thanks for the suggestion; however, desktop guide implements a new widget, and I can't do that in pygtk. Specifically: static void