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
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.
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
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
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
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
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(
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
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
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
"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
"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
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]
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
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
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]
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
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
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]
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
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
"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
[ 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
[ 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
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]
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
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
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]
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
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
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]
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
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
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
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
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
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
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):
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
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
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
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
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
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
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
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
Richard, this patch makes class variables behave correctly when
inheriting from Gtk classes. Thanks.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
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
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
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]
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
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
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]
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
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
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
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
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
58 matches
Mail list logo