[pygtk] Bugs in GnomeMDIGenericChild

2000-02-21 Thread Frederic Gobry

Hi,

I've noticed some bugs in gnomeuimodule.c, line 966 and following: there are
a series of calls to gnome functions with GNOME_MDI_GENERIC_CHILD(mdi) as
argument, instead of GNOME_MDI_GENERIC_CHILD(PyGtk_Get (mdi)).

Frédéric
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Re: Small bug in GnomeIconSelection

2000-02-21 Thread Juergen Ehrensberger

Hi,

after adding the missing return statement in GnomeIconSelection.get_icon (line
1045 in ui.py) the method works correctly if an icon has been selected.
However, if nothing is selected it gives a segmentation fault.

Cheers
Juergen



from gtk import *
from gnome.ui import *

def get_icon(button, iconSel):
print iconSel.get_icon()

win = GtkWindow()
win.connect("destroy", mainquit)
vbox = GtkVBox()

iconSel = GnomeIconSelection()
iconSel.add_directory('/usr/share/pixmaps')
iconSel.show_icons()
vbox.pack_start(iconSel, expand=TRUE)

button = GtkButton("OK")
button.connect("clicked", get_icon, iconSel)
vbox.pack_start(button)

win.add(vbox)
win.show_all()
mainloop()

-- 
_

 /  __  /  /  / Jürgen Ehrensberger
/  /   /  /  /  Laboratoire de Télécommunications
   /  /  /  /   Ecole Polytechnique Fédérale de Lausanne
  /  /  /  /1015 Lausanne, Switzerland
_/ _/ _/ _/ Tel:  +41 21 693 46 94, Fax: +41 21 693 26 83
Mail: [EMAIL PROTECTED]
_
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Bug in GtkRet_FromPyObject

2000-02-21 Thread Frederic Gobry

I'm continuing my investigations on MDI ;-)

In gtkmodule.c, line 3041, isn't there a break missing ?

Frédéric

PS : I've write access to the Gnome CVS. Is it ok to fix these kind of bugs
without warning ?
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] How to use UIINFO_TOGGLEITEM

2000-02-21 Thread Juergen Ehrensberger

Hi all,

in a GnomeApp I created menus including a UIINFO_TOGGLEITEM. However, the
connected callback cannot determine the value of the toggle item, since it
receives a GtkObject of type GtkCheckMenuItem instead of the GtkCheckMenuItem
itself. Therefore the method call __getattr__("active") does not work. Is it
possible to access the GtkCheckMenuItem inside the GtkObject ? For GtkMenus
everything works just fine.

Cheers
Juergen


from gtk import *
from gnome.ui import *

def toggled(checkMenuItem):
print checkMenuItem
print checkMenuItem.__getattr__("active")

win = GnomeApp()
win.connect("destroy", mainquit)

# Gnome Menu
toggle_menu = [UIINFO_TOGGLEITEM("Toggle", cb=toggled)]
main_menu = [UIINFO_SUBTREE('GnomeMenu', toggle_menu)]
win.create_menus(main_menu)

# GtkMenu
vbox = GtkVBox()
gtkMenuBar = GtkMenuBar()
gtkMenuItem = GtkMenuItem("GtkMenu")
gtkSubMenu = GtkMenu()
gtkCheck = GtkCheckMenuItem("Toggle")
gtkCheck.connect("toggled", toggled)
gtkSubMenu.append(gtkCheck)
gtkMenuItem.set_submenu(gtkSubMenu)
gtkMenuBar.append(gtkMenuItem)
vbox.pack_start(gtkMenuBar, expand=TRUE)

win.set_contents(vbox)
win.set_usize(100,100)
win.show_all()
mainloop()

-- 
_

 /  __  /  /  / Jürgen Ehrensberger
/  /   /  /  /  Laboratoire de Télécommunications
   /  /  /  /   Ecole Polytechnique Fédérale de Lausanne
  /  /  /  /1015 Lausanne, Switzerland
_/ _/ _/ _/ Tel:  +41 21 693 46 94, Fax: +41 21 693 26 83
Mail: [EMAIL PROTECTED]
_
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] A last one on MDI

2000-02-21 Thread Frederic Gobry

Invoking a menu callback causes an Illegal instruction failure, or at least
in the code attached to this mail. Am I doing something wrong ?

Frédéric


from gnome.ui import *
from gtk import *


mdi = GnomeMDI ('test', 'test')

mdi.connect ('destroy', mainquit)

mdi.set_menubar_template ([
UIINFO_SUBTREE ("File", []),
UIINFO_SUBTREE ("Documents", [])
])

mdi.set_child_menu_path ("File")
mdi.set_child_list_path ("Documents/")

child = GnomeMDIGenericChild ('child')

def create_view (* arg):
return GtkLabel ("Hi !")
 
def callback (*arg):
print arg

child.set_view_creator (create_view)
child.set_menu_template ([UIINFO_SUBTREE ("Test",
  [UIINFO_ITEM ("gronf", None, callback)])])

mdi.add_child (child)
mdi.add_view  (child)

mainloop ()




[pygtk] Sure looks like a bug in gnome.config

2000-02-21 Thread Randolph Fritz

Looks like _gnome.gnome_config_private_list_section was changed to
_gnome.gnome_config_private_section_contents, but gnome/config.py
wasn't updated to match.  Context diff included.

Randolph Fritz
Eugene, Oregon, USA


*** /home/randolph/Install/gnome-python-1.0.51/pygnome/gnome/config.py  Wed Jan 26 
07:05:26 2000
--- /usr/lib/python1.5/site-packages/gnome/config.pyMon Feb 21 10:26:46 2000
***
*** 64,69 
  def private_has_section(path):
return _gnome.gnome_config_private_has_section(path)
! def private_list_section(path):
!   return _gnome.gnome_config_private_list_section(path)
  def private_enum_sections(path):
return _gnome.gnome_config_private_enum_sections(path)
--- 64,69 
  def private_has_section(path):
return _gnome.gnome_config_private_has_section(path)
! def private_section_contents(path):
!   return _gnome.gnome_config_private_section_contents(path)
  def private_enum_sections(path):
return _gnome.gnome_config_private_enum_sections(path)
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Archives not being updated?

2000-02-21 Thread Michael McLay


It looks like the email archives for the pygtk list stopped being
updated on 2000/02/10.

http://www.mail-archive.com/pygtk@daa.com.au/maillist.html
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] ignore - Archives not being updated

2000-02-21 Thread Michael McLay

Michael McLay writes:
  
  It looks like the email archives for the pygtk list stopped being
  updated on 2000/02/10.

Looks like it is a problem with the http://www.mail-archive.com/
service. They had a system crash and they are running in degradation
mode. 



To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Bindings for GtkExtra

2000-02-21 Thread Andreas Voegele

I'm currently writing Python bindings for the GtkExtra widget set
which is available at http://magnet.fsu.edu/~feiguin/gtk/.

Most of the work is done but I have two questions.

1. The C header file is called gtkextra.h therefore I called the
Python module gtkextra.py.  On non-posix systems this name may conlict
with GtkExtra.py.

Should I use gtkextra.py or should I use libgtkextra.py?

2. Like gtk_clist_get_selection_info(w, x, y) the function
gtk_sheet_get_pixel_info(w, x, y) returns None if the user clicked
outside of the cells.

On the other hand the functions gtk_sheet_get_active_cell(w) and
gtk_color_combo_find_color(w, color) return (-1, -1) as row and column
if no cell is active or the specified colour could not be found.

The C prototypes of the functions mentioned are:

void gint gtk_sheet_get_pixel_info(GtkSheet *, gint x, gint y,
   gint *row, gint *col);

void gtk_sheet_get_active_cell(GtkSheet *, gint *row, gint *col);

void gtk_color_combo_find_color(GtkColorCombo *, GdkColor *,
gint *row, gint *col);

I'm wondering if it wasn't better to return None instead of (-1, -1)
in order to be consistent with gtk_clist_get_selection_info().

What do you think?
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]