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

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 https://developer.

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 th

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(); pygobje

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 cy

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. Thi

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] Pay on Performance! Search engine positioning.

2000-06-22 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > On Wed, 21 Jun 2000, Hassan Aurag wrote: > > > To hell with spam. All the maintainer has to do with mailman is to > > disable posting for non-subscribed. Sure this kindda annoying, if > > you are subscribed but post from another email address. It's

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 inst

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("de

Re: [pygtk] pygtk extensionclass work

2000-03-26 Thread Hrvoje Niksic
This sounds yummy, even if my understanding of the specifics is vague. Could you please explain what "extensionclass" is, and how it will affect PyGtk? - To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

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

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 featu

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] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic
Matt Wilson <[EMAIL PROTECTED]> writes: > On Mon, Mar 13, 2000 at 09:10:06AM +0100, Hrvoje Niksic wrote: > > % python a.py > > GnomeUI-Message: The antialiased canvas is buggy. Please do not use it unless you >know what you are doing. > > I know what I'm do

Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic
Matt Wilson <[EMAIL PROTECTED]> writes: > On Sun, Mar 12, 2000 at 11:36:22PM -0500, François Pinard wrote: > > The code below shows the case of a line needing anti-aliasing. > > Would someone knowledgeable tell me if/how I can, within `pygtk', > > produce an anti-aliased line, or else (:-), how I

Re: [pygtk] X selection handling

2000-02-18 Thread Hrvoje Niksic
Rick Ree <[EMAIL PROTECTED]> writes: > I know this has been asked before, but I haven't found an answer > IIRC. Neither have I. (I asked the question before.) If you find out, please let me know if it's not already posted to the list. 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 mai

Re: [pygtk] post-only list

1999-11-15 Thread Hrvoje Niksic
"J.W. Bizzaro" <[EMAIL PROTECTED]> writes: > I would STRONGLY recommend using Mailman over Majordomo. We've used > it for nearly a year at The Open Lab, and not one spam message has > made it through the screening, and many have tried. It's very > simple to set up and administer too. Does Mail

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 writin

Re: [pygtk] Panel applet taking button2

1999-11-02 Thread Hrvoje Niksic
[ Has this response reached the list? I've sent it once, but I don't see it in my inbox. Sorry if you're reading this twice. ] James Henstridge <[EMAIL PROTECTED]> writes: > >From what I remember, the button press events are redirected to the panel > when you add the widget to the applet wit

[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]

[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 PROTEC

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, w

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

1999-10-31 Thread Hrvoje Niksic
Hrvoje Niksic <[EMAIL PROTECTED]> writes: > vbox.add(gtk.GtkRuler()) # Error here! Should have been GtkHRuler() (and I meant GtkHSeparator anyway). Sorry for the noise. To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

[pygtk] Ruler in vbox doesn't work

1999-10-31 Thread Hrvoje Niksic
Is there an explanation why this trivial program doesn't work? #!/usr/bin/python import gtk w = gtk.GtkWindow() vbox = gtk.GtkVBox() vbox.add(gtk.GtkRuler()) # Error here! w.add(vbox) w.show_all() gtk.quit_add_destroy(1, w) gtk.mainloop() The repo

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

[pygtk] GtkCombo.set_popdown_strings() should accept tuple

1999-03-02 Thread Hrvoje Niksic
It would be nice if GtkCombo's set_popdown_strings() method accepted a tuple (it currently only accepts a list.) To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Re: [pygtk] Hooking into Gtk iterations

1999-02-25 Thread Hrvoje Niksic
Aaron Optimizer Digulla <[EMAIL PROTECTED]> writes: > Quoting Hrvoje Niksic <[EMAIL PROTECTED]>: > > > > > > (does it have anything to do with the threading code?). > > > > I don't think so, no. > > > Yes, that's the same. Thr

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 consu

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 s

Re: [pygtk] Hooking into Gtk iterations

1999-02-25 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > I suppose you could use an idle function. It would get called for > each iteration of the main loop, and should allow the signal handler > to be called. I tried that now, but idle functions suck for that purpose. They are called all the time when

[pygtk] Hooking into Gtk iterations

1999-02-24 Thread Hrvoje Niksic
As you may have noticed, I'm writing a program that tries to track several of its children. It gets notified of a child's death by SIGCHLD. The problem is that Python signal processing is synchronous -- while in the C signal handler, Python simply queues the routine to be run at a later time. I

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

1999-02-23 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > Also, currently people can use the lower level _gtk module to write > GTK programs (and I know some people do use it -- they see it as a > good way of prototyping interfaces that can then be translated to C > very quickly). I wouldn't want this abil

Re: [pygtk] new snapshot of pygtk and gnome-python

1999-02-23 Thread Hrvoje Niksic
Richard Fish <[EMAIL PROTECTED]> writes: > Sam Tannous wrote: > > So what am I supposed to do now? > > Use class attributes referenced from self, or lambda's to pass the > class instance to your callbacks: [...] There is a third solution, kindly provided by Gtk: def clicked_cb (junk, button):

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

1999-02-23 Thread Hrvoje Niksic
Richard Fish <[EMAIL PROTECTED]> writes: > Hrvoje Niksic wrote: > > Sorry for the length. James, if you think this won't work, I'd like > > to see what I'm missing. > > I have a feeling it's not so much a matter of whether it will work > or not

[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 should

Re: [pygtk] exit()-ing from a child process loses

1999-02-23 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > As you may know, X programs talk to the X server through a network > socket connection. :-) Yes, I know that. However, wouldn't it be nice if Gtk+ supported a "quiet shutdown" routine that could be called by the child process? I have a hard time

Re: [pygtk] GLADE support for PyGTK

1999-02-23 Thread Hrvoje Niksic
James, do you plan to ever write a real code generator for Glade? I mean, the current glade support is a neat hack, but what I like about Glade and its ilk is that I can draw a picture of something, get a C program, and then modify it to my liking. I'd like to be able to do the same thing in Pyt

Re: [pygtk] exit()-ing from a child process loses

1999-02-23 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > You would get the same problem if you wrote a C GTK+ program that > forked and you called exit(). In this case, you would call _exit() > which bypasses all atexit handlers. Should I raise this question on the Gtk+ list? To unsubscribe: echo "unsubs

[pygtk] exit()-ing from a child process loses

1999-02-22 Thread Hrvoje Niksic
OK, here is another interesting problem which took several hours to track. When a Gtk program forks off, it inherits the X file descriptors from its parent. It seems that when I call sys.exit(), Gdk gains control (either through atexit() or through a PyGtk cleanup intercepting SystemExit), inter

Re: [pygtk] Inheriting from Gtk classes broken?

1999-02-22 Thread Hrvoje Niksic
Aaron Optimizer Digulla <[EMAIL PROTECTED]> writes: > > - When a Python object is created, it get's added to an internally > > maintained dictionary that maps the Gtk object to it's Python object. > > This increments the reference count of the Python object. > > Why is this neccessary ? Isn't is

Re: [pygtk] Inheriting from Gtk classes broken?

1999-02-21 Thread Hrvoje Niksic
Richard Fish <[EMAIL PROTECTED]> writes: > I think until we are able to pass the original python object to > signal handlers, we are better off just not having user-created > attributes available to the signal handlers. I think I agree with this. Fortunately, there are other ways of sharing dat

Re: [pygtk] Inheriting from Gtk classes broken?

1999-02-20 Thread Hrvoje Niksic
Richard, this patch makes class variables behave correctly when inheriting from Gtk classes. Thanks. To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

[pygtk] Inheriting from Gtk classes broken?

1999-02-20 Thread Hrvoje Niksic
Uh, I think I've found another problem with the new snapshot. According to Python reference manual, I should be able to use class variables as default values to class instances. For example: class Foo: home = os.environ["HOME"] ... methods in which the class instance can change the valu

Re: [pygtk] Wisdom of `from gtk import *'

1999-02-19 Thread Hrvoje Niksic
Richard Fish <[EMAIL PROTECTED]> writes: > Hrvoje Niksic wrote: > > James, what do you think about such a scheme? > > I don't know about James, but I regularly (usually) use "import gtk" > rather than "from gtk import *", with no real side

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]

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 unsubscri

[pygtk] Wisdom of `from gtk import *'

1999-02-19 Thread Hrvoje Niksic
It's probably late to raise this topic, but I'd still like to hear opinions. The thing is, `gtk.py' advocates `from gtk import *' as a good way to import the Gtk functionality and then uses the Gtk prefix to ensure namespace integrity. However, I'm not sure it really buys us much. I mean, impor

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]

[pygtk] Popup menus

1999-02-18 Thread Hrvoje Niksic
Has anyone succeeded in creating popup menus with PyGtk? I tried and failed -- but then, I'm fairly new at Gtk, so I might be doing something wrong on that front. Here is the extract from the code I've tried to run: from gtk import * from GDK import * class someclass (GtkWindow): def __in

Re: [pygtk] Types in pygtk

1999-02-17 Thread Hrvoje Niksic
James Henstridge <[EMAIL PROTECTED]> writes: > I have fixed up the DnD target list problem. You should now be able > to use any sequence type for the target list. Thanks. I assume by "now" you mean in the next released version? > The string -> colour conversion may be a bit trickier, as it ma

[pygtk] Types in pygtk

1999-02-17 Thread Hrvoje Niksic
I think the "upper" layer of pygtk should be more convenient about types used in Python. Specifically, it should try not to imitate "C", where you have to spell everything out, but take advantage of a language where you can actually check the type of your arguments. Let me illustrate this by seve

[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 pyg

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 gwm_desktop_cl