Re: [pygtk] ANN: guis-1.2 a (pygtk based) GTK2 widget server

2003-09-01 Thread Christian Reis
On Mon, Sep 01, 2003 at 11:03:24AM +0200, Basile STARYNKEVITCH wrote:
> It is my pleasure to announce the availability of Guis, which is a
> programmable graphical user interface widget "server".

-> FAQ 23.2

http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq23.002.htp

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] 'About' strangeness.

2003-09-01 Thread Colin Fox
On Thu, 2003-10-02 at 09:34, Jon Willeke wrote:
> See PyGTK FAQ 10.6 for my description of how to use gnome.ui.About:
> 
>

> 
> In short, you have to stop the emission of the "reponse" signal. 
Returning 
> True is not sufficient.
> 
> I've asked in GNOME bug 119405 whether this is expected behavior. 
There is 
> a tentative response that is not.

Hmm. I put this in:

def on_aboutbox_response( dialog, arg1, *args ):
if arg1 < 0:
dialog.hide()
dialog.emit_stop_by_name( 'response' )

This causes it to work properly if the user clicks the "Ok" button, but
it's a hack. Why should you have to force a signal to be stopped just
because you're using an about box? I don't think the old versions of the
library required such contortions... Regardless, if the user clicks the
close box, it will still crash when you try to re-invoke it.

I'm catching the close signal, and it NEVER gets sent. That seems to be
a bug, too. Same with the delete event. The ONLY event sent by the about
box is 'response'. 

Also the fact that there's a segfault instead of a normal python
stacktrace indicates this is a bug within one of the libraries, though I
have no idea which one.

cf
-- 
Colin Fox <[EMAIL PROTECTED]>
CF Consulting Inc.


signature.asc
Description: This is a digitally signed message part
___
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] 'About' strangeness.

2003-09-01 Thread Jon Willeke
See PyGTK FAQ 10.6 for my description of how to use gnome.ui.About:



In short, you have to stop the emission of the "reponse" signal.  Returning 
True is not sufficient.

I've asked in GNOME bug 119405 whether this is expected behavior.  There is 
a tentative response that is not.

At 01:11 AM 9/1/03 -0700, Colin Fox wrote:
On Mon, 2003-09-01 at 00:51, David M. Cook wrote:
> > If I show the about box, then dismiss it, then show it again, my program
> > aborts immediately with a segfault. No traceback stack or anything. I've
> > tried handling the 'response' and 'close' signals (hiding the dialog &
> > returning gtk.TRUE), to no avail.
>
> You also need to handle the delete_event signal and keep it from 
propagating
> by returning gtk.TRUE.

Hmm. The About box is getting stranger. I am now catching delete_event,
close & response. Here are my functions:
def on_about2_delete_event(widget, event=None):
print "delete_event"
return gtk.TRUE
def on_about2_response(widget, event=None):
print "response"
return gtk.TRUE
def on_about2_close(widget, event=None):
print "close"
return gtk.TRUE
I have the appropriate signals set up in Glade, calling these functions.

According to this, the ONLY function getting called is
on_about2_response(). The delete & close functions never execute.
And I still get a segfault when I try to re-show the about box.

cf

ps. I wonder if this has anything to do with the problem James has
mentioned about the improper invocation of gnome_program_init() from
libgnome?
___
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] using pygtk to create plots on a server w/ no DISPLAY

2003-09-01 Thread Christian Reis
On Sun, Aug 31, 2003 at 10:34:39AM -0500, John Hunter wrote:
> I have a plotting library that uses pygtk with gtk.DrawingArea and
> gtk.gdk.Drawable to make plots.  I would like to use it from a zope
> server running on a headless linux box to dynamically generate plots
> to embed n html.  If X is running on the server is there any to draw,
> for example to a pixmap, and then save the figure as a PNG, and then
> embed it in the html, w/o X ever launching the window?

Have you considered using Xvfb? It's pretty much designed to do what you
want.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] 'About' strangeness.

2003-09-01 Thread Christian Reis
On Mon, Sep 01, 2003 at 01:22:00AM -0700, Colin Fox wrote:
> Cool. So now I have:
> 
> aboutbox.set_property('name','Demo Program')
> aboutbox.set_property('version','0.1')
> 
> and it works. I don't remember seeing any docs on this anywhere.
> Would it be worth putting this into the FAQ?

http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq19.007.htp

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] Runing events outside of window

2003-09-01 Thread Christian Reis
On Sun, Aug 31, 2003 at 07:07:43PM -0700, [EMAIL PROTECTED] wrote:
> I have an small script that I want to show a clock couting down.
> 
> or really what I want is I have a small scrits that starts counting down
> and then at a certain time left, a small window pops up and says one
> minute left.  Unfortuatenly, at the point, time can run out, but the

Don't you really want to use timeout_add here?

http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq20.007.htp

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] ANN: guis-1.2 a (pygtk based) GTK2 widget server

2003-09-01 Thread Basile STARYNKEVITCH
Dear All,


It is my pleasure to announce the availability of Guis, which is a
programmable graphical user interface widget "server".

Guis communicate with a (one) client application thru textual
communication channels; input requests (from application to guis) are
Python instructions (using the PyGTK binding to GTK2) and output
replies (or events) are arbitrary textual lines from Guis to
application (sent by Python code). There is a possibility to trace the
exchanges between application & guis (in a graphical window)


Guis is therefore a programmable (in Python) GTK2 widget server.

The GTK related code of Guis can easily be ported to any embeddable
scripting language offering a GTK2 binding.

Guis is opensource, under GNU General Public License, developped under
Linux.

See http://www.starynkevitch.net/Basile/guisdoc.html for documentation
on Guis, and also http://freshmeat.net/propjects/guis/ and download
source code (with demo) from
http://www.starynkevitch.net/Basile/guis-1.2.tar.gz (a 348289  GNU
gzipped tar file of md5sum bec63b8e6874232a269e7e83ff4e916a)

Comments, suggestions and patches are welcome!

(PS a previous incompatible version 0.3 of guis was scriptable in lua)

Regards
-- 

Basile STARYNKEVITCH http://starynkevitch.net/Basile/ 
email: basilestarynkevitchnet 
aliases: basiletunesorg = bstarynknerimnet
8, rue de la Faïencerie, 92340 Bourg La Reine, France
___
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] 'About' strangeness.

2003-09-01 Thread Colin Fox
On Mon, 2003-09-01 at 00:48, Malcolm Tredinnick wrote:
> Set the 'name' and 'version' properties on the GnomeAbout widget before
> the widget is shown. I can see the logic of not setting the version
> number in Glade (it changes more often than you want to change your
> .glade file), but the lack of name setting has always seemed a bit odd,
> I agree.

Cool. So now I have:

aboutbox.set_property('name','Demo Program')
aboutbox.set_property('version','0.1')

and it works. I don't remember seeing any docs on this anywhere.
Would it be worth putting this into the FAQ?

> By the way, the name you want shown in the about box is not necessarily
> the name string you pass in to the gnome.init() method. It really wants
> to be the same as whatever the 'human-readable-name' property of
> GnomeProgram to (if you set that property), but that is getting pretty
> subtle (not a lot of programs do that).

Ok - is there some documentation somewhere that states all of the
properties of the various Gnome components and their purposes?

Thanks for the help!
  cf
-- 
Colin Fox <[EMAIL PROTECTED]>
CF Consulting Inc.


signature.asc
Description: This is a digitally signed message part
___
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] 'About' strangeness.

2003-09-01 Thread Colin Fox
On Mon, 2003-09-01 at 00:51, David M. Cook wrote:
> > If I show the about box, then dismiss it, then show it again, my program
> > aborts immediately with a segfault. No traceback stack or anything. I've
> > tried handling the 'response' and 'close' signals (hiding the dialog &
> > returning gtk.TRUE), to no avail.
> 
> You also need to handle the delete_event signal and keep it from propagating
> by returning gtk.TRUE.

Hmm. The About box is getting stranger. I am now catching delete_event,
close & response. Here are my functions:

def on_about2_delete_event(widget, event=None):
print "delete_event"
return gtk.TRUE

def on_about2_response(widget, event=None):
print "response"
return gtk.TRUE

def on_about2_close(widget, event=None):
print "close"
return gtk.TRUE

I have the appropriate signals set up in Glade, calling these functions.

According to this, the ONLY function getting called is
on_about2_response(). The delete & close functions never execute.

And I still get a segfault when I try to re-show the about box.

cf

ps. I wonder if this has anything to do with the problem James has
mentioned about the improper invocation of gnome_program_init() from
libgnome?
-- 
Colin Fox <[EMAIL PROTECTED]>
CF Consulting Inc.


signature.asc
Description: This is a digitally signed message part
___
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] 'About' strangeness.

2003-09-01 Thread David M. Cook
On Mon, Sep 01, 2003 at 12:40:11AM -0700, Colin Fox wrote:

> In addition to my previous message about the missing yellow star in the
> About menu, the "Gnome About" dialog itself is causing me some grief.
> 
> If I show the about box, then dismiss it, then show it again, my program
> aborts immediately with a segfault. No traceback stack or anything. I've
> tried handling the 'response' and 'close' signals (hiding the dialog &
> returning gtk.TRUE), to no avail.

You also need to handle the delete_event signal and keep it from propagating
by returning gtk.TRUE.

Dave Cook
___
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] 'About' strangeness.

2003-09-01 Thread Malcolm Tredinnick
On Mon, 2003-09-01 at 17:48, Malcolm Tredinnick wrote:
> On Mon, 2003-09-01 at 17:40, Colin Fox wrote:
> > In addition to my previous message about the missing yellow star in the
> > About menu, the "Gnome About" dialog itself is causing me some grief.
> > 
> > If I show the about box, then dismiss it, then show it again, my program
> > aborts immediately with a segfault. No traceback stack or anything. I've
> > tried handling the 'response' and 'close' signals (hiding the dialog &
> > returning gtk.TRUE), to no avail.
> 
> Catch the 'delete' signal and ignore it (return gtk.TRUE). That will
> prevent the widget from being deleted.

Sorry, that should be the 'delete-event' signal.

Typing without checking. :-(

Cheers,
Malcolm

___
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] 'About' strangeness.

2003-09-01 Thread Malcolm Tredinnick
On Mon, 2003-09-01 at 17:40, Colin Fox wrote:
> In addition to my previous message about the missing yellow star in the
> About menu, the "Gnome About" dialog itself is causing me some grief.
> 
> If I show the about box, then dismiss it, then show it again, my program
> aborts immediately with a segfault. No traceback stack or anything. I've
> tried handling the 'response' and 'close' signals (hiding the dialog &
> returning gtk.TRUE), to no avail.

Catch the 'delete' signal and ignore it (return gtk.TRUE). That will
prevent the widget from being deleted.

> Also, in Glade, the dialog box shows "programname X.X" - however when I
> bring up the about box from my program, nothing is shown in that space.

Set the 'name' and 'version' properties on the GnomeAbout widget before
the widget is shown. I can see the logic of not setting the version
number in Glade (it changes more often than you want to change your
.glade file), but the lack of name setting has always seemed a bit odd,
I agree.

By the way, the name you want shown in the about box is not necessarily
the name string you pass in to the gnome.init() method. It really wants
to be the same as whatever the 'human-readable-name' property of
GnomeProgram to (if you set that property), but that is getting pretty
subtle (not a lot of programs do that).

Cheers,
Malcolm
___
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] 'About' strangeness.

2003-09-01 Thread Colin Fox
In addition to my previous message about the missing yellow star in the
About menu, the "Gnome About" dialog itself is causing me some grief.

If I show the about box, then dismiss it, then show it again, my program
aborts immediately with a segfault. No traceback stack or anything. I've
tried handling the 'response' and 'close' signals (hiding the dialog &
returning gtk.TRUE), to no avail.

Also, in Glade, the dialog box shows "programname X.X" - however when I
bring up the about box from my program, nothing is shown in that space.

I am calling gnome.init during the initialization of my program:

---
#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gnome.ui, gnome
gnome.init("dbbrowse", "1.0")
import gtk.gdk, gobject, sys,gtk.glade,string
...


Is there something else I need to do?

cf
-- 
Colin Fox <[EMAIL PROTECTED]>
CF Consulting Inc.


signature.asc
Description: This is a digitally signed message part
___
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] Missing about icon in menu

2003-09-01 Thread James Henstridge
On 1/09/2003 3:07 PM, Colin Fox wrote:

For some reason, when I create a Gnome project, and add a Gnome app
window, the yellow star beside the About menu doesn't show up in my
program. It shows up in the glade editor, though.
All the other icons in the menus are fine. Just the about star is
missing.
Is anyone else getting this, or is there something strange about my
setup?
 

I just left a note in the bug report you filed about this.  The bug is 
in libgnome, and has been fixed in CVS (both 2.2 and 2.4 branches).  
There have been tarball releases on the 2.4 branch since then, but not 
2.2 branch.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


___
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] Missing about icon in menu

2003-09-01 Thread Malcolm Tredinnick
On Mon, 2003-09-01 at 17:07, Colin Fox wrote:
> For some reason, when I create a Gnome project, and add a Gnome app
> window, the yellow star beside the About menu doesn't show up in my
> program. It shows up in the glade editor, though.
> 
> All the other icons in the menus are fine. Just the about star is
> missing.
> 
> Is anyone else getting this, or is there something strange about my
> setup?

No, it's pretty much just you. (He says looking at the application he's
working on that has a nice shiny yellow star next to "About".)

The only thing that immediately comes to mind is that the About icon is
one of the few stock icons that comes from libgnomeui, rather than GTK+.
So have you imported gnome.ui and run gnome.init_program()?

Cheers,
Malcolm

___
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] Missing about icon in menu

2003-09-01 Thread Colin Fox
For some reason, when I create a Gnome project, and add a Gnome app
window, the yellow star beside the About menu doesn't show up in my
program. It shows up in the glade editor, though.

All the other icons in the menus are fine. Just the about star is
missing.

Is anyone else getting this, or is there something strange about my
setup?

cf


signature.asc
Description: This is a digitally signed message part
___
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] Runing events outside of window

2003-09-01 Thread dude
Hello all.
I have a questin.  I understaand gui as dependant on user action.
It waits and does nothing until it responds.

I have an small script that I want to show a clock couting down.

or really what I want is I have a small scrits that starts counting down
and then at a certain time left, a small window pops up and says one
minute left.  Unfortuatenly, at the point, time can run out, but the
session will not end, unless the gui window is killed or the Ok button
is clicked on and it kills it self.

I am not sure in what direction to go in.

all help appreciate. these are the lines of code


#!/usr/bin/python2.2
""" Track user time by writing to the NFS mounted home"""
import time
import sys
import killXinit
import guiWarning

def fileTimeStamp():
fileTimeStamp = time.localtime()[0], time.localtime()[1],time.localtime()[2], 
time.localtime()[3], time.localtime()[4]
return fileTimeStamp

timeFile = open(".RTuserTimeStamp", "r+")
timeFileData = timeFile.readlines()

#Determine user
userData =  timeFileData[1].split()
user = userData[2]

#Determine TimePaid
timePaidData = timeFileData[2].split()
timePaid = timePaidData[2]

#Detemine TimeUSED
timeUsedData = timeFileData[3].split()
print timeUsedData
timeUsed = timeUsedData[2]

#BEGIN CLOCK
timeStart = time.time()
timeLeft = 10

print "TIME LEFT", timeLeft

while timeLeft > (time.time() - timeStart):
if int(time.time() - timeStart) == 4:
guiWarning.startWindow()
print time.time()
time.sleep(1)
else:
timeFile.writelines("last written %s\n"%str(fileTimeStamp()))
#killXinit.killX()
print "DONE!"
#sys.exit()

timeFile.close()





""" Ok, have a profiler of who is logged on. It seems that when people log on via NFS 
its hard to figure out who is current being exported out. Loggin in and mounting the 
home terminal does not show up on bubs"""

#!/usr/bin/python2.2
import pygtk
pygtk.require('2.0')
import gtk
import time
import commands

def startWindow():
timeStart = time.time()
timeLeft = 2
if time.time() - timeStart > timeLeft:
whatPID = commands.getoutput('ps -A')
PIDlist = whatPID.split('\n')
for x in PIDlist:
if x.find('XFree86') >0:
Xfound = x
parseXfound = Xfound.split()
report = commands.getstatusoutput('kill %s 1'%parseXfound[0])
print report
class Window:
def quit(self, widget, data = None):
gtk.main_quit()

def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("TEST")
self.window.set_border_width(10)


self.VBoxMain = gtk.VBox(gtk.FALSE,0)
self.VBoxMain.show()
self.window.add(self.VBoxMain)

self.label = gtk.Label("USER ACCOUNT INFO")
self.label.show()
self.VBoxMain.pack_start(self.label)

self.HBox1 = gtk.HBox(gtk.FALSE,0)
self.HBox1.show()
self.VBoxMain.pack_start(self.HBox1)

self.timeLabel = gtk.Label("Current time: ")
self.timeLabel.set_justify(gtk.JUSTIFY_LEFT)
self.timeLabel.show()
self.HBox1.pack_start(self.timeLabel)

self.timeDisplayLabel = gtk.Label()
self.timeDisplayLabel.set_markup('YOU HAVE ONE MINUTE BEFORE BEING LOGGED 
OUT.' )
self.timeDisplayLabel.show()
self.HBox1.pack_start(self.timeDisplayLabel)

self.HBox2 = gtk.HBox(gtk.FALSE,0)
self.HBox2.show()
self.VBoxMain.add(self.HBox2)

self.okButton = gtk.Button("OK?")
self.okButton.connect("clicked", self.quit)
self.okButton.show()
self.HBox2.pack_start(self.okButton, gtk.TRUE, gtk.TRUE,0)


self.window.show()

def main(self):
gtk.main()

window = Window()
window.main()


#!/usr/bin/python2.2
""" Determine what xinit is and kill it
Most likely needs to run as root"""

def killX():
import commands
whatPID = commands.getoutput('ps -A')
PIDlist = whatPID.split('\n')

for x in PIDlist:
if x.find('XFree86') >0:
Xfound = x
print "FOUND"

print Xfound
parseXfound = Xfound.split()

report = commands.getstatusoutput('kill %s 1'%parseXfound[0])
print report
___
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] Multiple Windows and Glade

2003-09-01 Thread Gustavo J A M Carneiro
A Seg, 2003-09-01 às 00:10, Colin Fox escreveu:
> On Sun, 2003-08-31 at 15:51, Federico Di Gregorio wrote:
> > > The trouble is when I want to show multiple simultaneous versions of it,
> > > each with different data.
> > > 
> > > Does anyone know of any examples doing this, or of any documentation
> > > that explains how?
> > 
> > well, just load the view with glade.XML multiple times.
> 
> Hmm. Ok, but would that mean that I'm re-interpreting the whole glade
> file every time the window gets opened? If so, that would be pretty
> memory and time intensive.
> 

> Or is the glade library smart enough to cache it?
  That's exactly what happens.

-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/