Re: [pygtk] showing/hiding dialogs

2001-06-19 Thread Niklas Saers Mailinglistaccount

Thanks very much to Steven Cresawn who pointed out the close_hides()
function that did the trick. Indeed, regular closing must destroy it, but
with this set to 1 it hides it instead. The following diff should solve
the problem for the file I attached as requested:

33a34
>   self.about.close_hides(1)

Thanks everyone. :)

Cheers

Nik


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] showing/hiding dialogs

2001-06-19 Thread Niklas Saers Mailinglistaccount

On Sat, 16 Jun 2001, Christian Robottom Reis wrote:

> It might not be that trivial. It depends on how you destroy the popup
> window;

Are there many non-trivial ways to destroy a popup window?

> I think you'll need to tie up some signals to avoid these errors.
> Can we see a code snippet?

Sure, included is a gtk application based on glade whose only function is
to reproduce the errors when opening about and preferences. Note that
first time you open it, it is fine. Then, when you close it by pressing
the X or something and try opening it again, it will produce the following
error:

Gtk-CRITICAL **: file gtkstyle.c: line 513 (gtk_style_attach): assertion
`style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 1134 (gtk_style_set_background):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 3613 (gtk_paint_flat_box):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkcontainer.c: line 739
(gtk_container_dequeue_resize_handler): assertion
`GTK_CONTAINER_RESIZE_PENDING (container)' failed.


> > ask these kinds of questions? If so, would anyone be so kind as to tell me
> > what list I should go to instead?
> I think the proper procedure it to write here and if nobody answers, whine
> a bit about it. You did get a lot of answers to your repost, so I say it
> works, too. 8-P

Indeed, and this puzzles me. But as long as I can keep on coding I can
ponder about the mailinglist in between. ;)

Cheers

  Nik


import traceback, threading, sys
import gtk, gnome.config, libglade
from gnome.ui import *
from GDK import *


class Window:
def __init__(self,filename):
self.xml  = libglade.GladeXML(filename)
self.registerWidgets(self.xml)
self.registerHandlers(self.xml)

def registerWidgets(self,xml):
# Main Windows
self.win = xml.get_widget('client')
self.preferences = xml.get_widget('preferences')
self.about   = xml.get_widget('about')

# Window components
self.status  = xml.get_widget('statusBar')

def registerHandlers(self,xml):
xml.signal_connect('close_window', gtk.mainquit)
xml.signal_connect('on_exit_activate', gtk.mainquit)

xml.signal_connect('on_preferences_activate',  self.menuPreferences)
xml.signal_connect('on_about_activate',self.menuAbout)

def menuPreferences(self, *args):
self.preferences = self.xml.get_widget('preferences')
self.preferences.show_all()

def menuAbout(self, *args):
self.about.show()


def main():
win = Window('client.glade')
gtk.mainloop()
gnome.config.sync()


if __name__ == '__main__':
 main()







  Client
  client
  
  src
  pixmaps
  C
  True
  True



  GnomeApp
  client
  Client
  GTK_WINDOW_TOPLEVEL
  GTK_WIN_POS_NONE
  False
  False
  True
  False
  True

  
GnomeDock
GnomeApp:dock
dock1
True

  0
  True
  True



  GnomeDockItem
  dockitem1
  2
  GNOME_DOCK_TOP
  0
  0
  0
  False
  True
  False
  True
  False
  GTK_SHADOW_OUT

  
GtkMenuBar
menubar1
GTK_SHADOW_NONE


  GtkMenuItem
  file1
  GNOMEUIINFO_MENU_FILE_TREE

  
GtkMenu
file1_menu


  GtkPixmapMenuItem
  new_file1
  
activate
on_new_file1_activate
Tue, 19 Jun 2001 16:22:26 
GMT
  
  GNOMEUIINFO_MENU_NEW_ITEM
  _New File



  GtkPixmapMenuItem
  open1
  
activate
on_open1_activate
Tue, 19 Jun 2001 16:22:26 
GMT
  
  GNOMEUIINFO_MENU_OPEN_ITEM



  GtkPixmapMenuItem
  save1
  
activate
on_save1_activate
Tue, 19 Jun 2001 16:22:26 
GMT
  
  GNOMEUIINFO_MENU_SAVE_ITEM



  GtkPixmapMenuItem
  save_as1
  
activate
on_save_as1_activate
Tue, 19 Jun 2001 16:22:26 
GMT
  
  GNOMEUIINFO_MENU_SAVE_AS_ITEM



  GtkMenuItem
  separator1
  False



  GtkPixmapMenuItem
  exit1
  
activate
on_exit1_activate
  

[pygtk] showing/hiding dialogs

2001-06-16 Thread Niklas Saers Mailinglistaccount

Hi, about ten days I asked the question under which I assume is fairly
trivial to most people in this list. Therefore, ten days later I'm quite
confused about not having a single answer back. Is this the wrong list to
ask these kinds of questions? If so, would anyone be so kind as to tell me
what list I should go to instead?

Cheers

  Nik



Hi all. I've made a nice little thingy with Glade, and connected the
About menu to a function that does a self.about.show() (I've attached the
about widget to self.about earlier) and it shows just fine. Then I close
it and open it again, and I get the following error message. Can anyone
tell me why I get this and what I am doing wrong?


Gtk-CRITICAL **: file gtkstyle.c: line 513 (gtk_style_attach): assertion
`style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 1134 (gtk_style_set_background):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 3613 (gtk_paint_flat_box):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkcontainer.c: line 739
(gtk_container_dequeue_resize_handler): assertion
`GTK_CONTAINER_RESIZE_PENDING (container)' failed.

Cheers

  Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] showing/hiding dialogs

2001-06-05 Thread Niklas Saers Mailinglistaccount

Hi all. I've made a nice little thingy with Glade, and connected the
About menu to a function that does a self.about.show() (I've attached the
about widget to self.about earlier) and it shows just fine. Then I close
it and open it again, and I get the following error message. Can anyone
tell me why I get this and what I am doing wrong?


Gtk-CRITICAL **: file gtkstyle.c: line 513 (gtk_style_attach): assertion
`style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 1134 (gtk_style_set_background):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 3613 (gtk_paint_flat_box):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkcontainer.c: line 739
(gtk_container_dequeue_resize_handler): assertion
`GTK_CONTAINER_RESIZE_PENDING (container)' failed.

Cheers

  Niklas Saers

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] gtk init

2000-12-14 Thread Niklas Saers Mailinglistaccount

Hey. While following  http://www.baypiggies.org/10mintig.html it asks me
to do an  "from gtk import *". However, this produces the following error:
Traceback (most recent call last):
  File "", line 1, in ?
  File "gtk.py", line 4, in ?
from gnome.ui import *
  File "/usr/local/lib/python2.0/site-packages/gnome/ui.py", line 16, in ?
_obj2inst = _gtk._obj2inst
AttributeError: _obj2inst

When I directly afterwards do a "from gtk import *" it is all right. Is
this some kind of init error? Is there any way to fix this?

Cheers

  Nik


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Fonts

2000-06-13 Thread Niklas Saers Mailinglistaccount

> font = load_font('-adobe-helvetica-medium-r-normal-*-*-80-*-*-*-*-*-*')

Great, thank's a lot! :) BTW, how is this string above defined?

Sincerely yours

Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] Fonts

2000-06-13 Thread Niklas Saers Mailinglistaccount

In gtk.py in GtkText there is

def insert(self, font, fg, bg, string):
_gtk.gtk_text_insert(self._o, font, fg, bg, string,
 len(string))

Could anyone tell me what kind of font this is? Following the
Gtk-documentation I would say it should be a GdkFont but I can't seem to
find this class reflected in the pygtk files, and GDK.py doesn't help out
much.

Thanks in advance

Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Init trouble

2000-06-12 Thread Niklas Saers Mailinglistaccount

> won't use it.  If it was installed and you don't want gnome to use it,
> start the control center and go to the sound properties capplet and
> uncheck the "enable sound server startup" check box.  That should fix the
> problem.

Er, it IS unchecked and has been so the entire time. Which is why I find
it strange that every py-gnome application tries to access /dev/dsp. Most
other gnome-applications don't.

Sincerely yours

   Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Init trouble

2000-06-11 Thread Niklas Saers Mailinglistaccount

> Actually, I was seriously considering making a null library (that has all
> the right calls but no code). Call it "equiet" and ln -s it to the esound
> locations.:)

Ok, so bottom line is that this is something which should be fixed in
Gnome, right? If so, who should we let know about this (to have it fixed)
and who should contact that person(s)? No point in everyone here telling
about it as that would be like a flame and make the author reluctant to
doing this.

   Niklas


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] More source

2000-06-10 Thread Niklas Saers Mailinglistaccount

Would anyone be so kind as to point me in the direction of applications /
applets written with gnome-python? I really want to learn more about it
and as I've been unable to find documentation besides source and
gtk C-documentation I'd love to read some programs which use gnome-python

Sincerely yours

Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] Questions / Bugs?

2000-06-09 Thread Niklas Saers Mailinglistaccount

Hi. 
1) When I make an applet or an application I get all the time:

/convert: No such file or directory
gdk_imlib ERROR: Cannot load image: /home/niklas/.themes/Aqua/gtk/background.png
All fallbacks failed.

The filename which it cannot load varies of course, but why does it look
for /convert??? Seems like a VERY illogical place for a program to be.


2) Where can I find good documentation for gnome-python and pygtk? Right
now I read source as that's all the documentation (except for a quick
intro) which I've been able to find. A refference would be good, for
instance

3) Why don't applets and applications which go into mainloop() respond to
ctrl-c??

4) Now I need to add --disable-sound ALL the time. Is there any way I can
make this go away??


Thanks in advance

Niklas


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Init trouble

2000-06-08 Thread Niklas Saers Mailinglistaccount

> Well, the /dev/dsp message is due to the gnome-libs initialising esd.  I
> don't know about the Alarm clock message.  Try passing the --disable-sound
> argument to your program to disable esd usage and see if that makes a
> difference.

Dear James, that seemed to do the trick about that. :) Thank you very
much. Now that I've at least got the userinterface running there are lots
of errors concerning /convert. It sais:

/convert: No such file or directory
gdk_imlib ERROR: Cannot load image: 
All fallbacks failed

This happens when it loads and when I move the mouse over it.


And then a completely other thingy: How do I connect signals to Python
def's with glade-python?

Thanks for your help
 
  Sincerley yours

Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] Init trouble

2000-06-07 Thread Niklas Saers Mailinglistaccount

Hi. When I do a 

import gnome.ui

(or applet or capplet) or even just 
python /usr/local/lib/python1.5/site-packages/gnome/ui 
then I get first Permission denied to /dev/dsp0 (which is ok since I don't
have a soundcard which is supported on my FreeBSD 4.0 box) and then I get
an 'Alarm clock' and it ends. The modules seem to end in the
initialization of the python-files. Can anyone help me out on what this
error is and how I can make it go away so that I can work with my glade
projects? I'm using python 1.5 and python-glade 1.53

Sincerely yours
   Niklas Saers


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk