Re: [pygtk] applets libglade

2003-03-07 Thread Martin Preishuber
Hi,well actually the visibility behaviour of the GtkWindows changed
from glade1 to glade2 ... I just was used to use .Show() and was suprised,
that the windows are visibile per default now ... and late in the night, I
didn't think of such a simple thing like checking the visibility setting
:|Martin

- Original Message From:
"Christian Reis" [EMAIL PROTECTED]To: "Martin Preishuber"
[EMAIL PROTECTED]Cc: "Johan Dahlin"
[EMAIL PROTECTED], [EMAIL PROTECTED]Subject: Re: [pygtk]
applets  libgladeDate: 06/03/03 14:07On Wed, Mar 05, 2003 at 11:57:24PM +0100, Martin Preishuber
wrote:   2.) I create some windows with glade (pygtk2
1.99.15), to use it I do   something like: 
   xml = gtk.glade.XML(gladefile) 
   this works fine, but it immidiately shows the window
... is there any   way to load it invisible and set it to
visible manually later ? I need   to fill some parts of the
window before it is visible.   Go into glade, mark
the window, go the Common tab, uncheck Visible. thanks again
... how comes, that I feel somehow stupid now ? :|You shouldn't.
This is a very common problem when using liglade to builda complex
application -- the parse of the file has the side-effect ofrendering the
window when it's marked as visible.I've discussed this before, and
I'm not sure there is a good solution tothe problem. On one hand, you
could ignore the visible attribute fortop-level windows, but that would
be violating the 1-1 correspondencebetween gladefile and libglade tree
which is expected. On the otherhand, you could have Glade make
GtkWindows not visible my default; butthen you have a consistency issue
between windows and other widgets.I don't see solutions (beyond
stuff likeGladeXML("foo.glade", invisible_windows=1)which I
don't like very much). But maybe somebody else does.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/pygtkRead the
PyGTK FAQ: http://www.async.com.br/faq/pygtk/

___
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] Destroying a widget

2003-03-07 Thread Christian Reis
On Fri, Mar 07, 2003 at 03:05:56PM +0100, [EMAIL PROTECTED] wrote:
 I have a list-widget, which I would like to display a popup menu or rather
 a Optionmenu in one of the columns, I've done this by using a VBox next to
 the list-widget and packing it with OptionMenus, but when changing the
 list, I can't delete the OptionMenus, or rather, it appears I _can_ delete
 them, but not attach a new menu to them.

If you are using PyGTK-0.x this will be much more complicated than using
the new TreeView in PyGTK-1.99/2.x. The original List/CList widgets are
very much targetted at text.

 I've been using both optionmenu.destroy() and vbox.destroy_children() (or
 whatever the name), but I still can't add a menu to the new OptionMenus.

Have you tried creating a GtkMenu manually and then using
optionmenu.set_menu()?

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] putting a treeview column in 'edit mode'

2003-03-07 Thread Thomas Speck
On Fri, 2003-03-07 at 14:40, florian wrote:
 hi!
 
 im wondering if its possible to put a treeview column
 automatically/or manually via the code in 'edit mode'.
 
 basically have a shortcut which creates a new row
 in the treeview. i would like that the user can then
 right away type the text in a column of that just
 created row.
 
 thanks in advance!
 
 ciao!
 florian
 
tree_view.set_cursor( path, col, gtk.TRUE )
tree_view.grab_focus()

should do it.

Thomas


___
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] Port of pugtk-1.99.15 on win32

2003-03-07 Thread Christian Reis
On Wed, Mar 05, 2003 at 09:40:08PM +0100, Cedric Gustin wrote:
 http://www.pcpm.ucl.ac.be/~gustin/win32_ports/

Added to FAQ. I had to remove the link to the older version for Python
2.1 because the link was broken - has it been murdered? 

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] TreeList check boxes

2003-03-07 Thread Jay Graves
Oops I guess I should have read James' reply a bit more thoroughly.
Thanks for putting me on the right track.  Just for the record the args
passed back when the toggle is clicked are not
(cell, path_string, model) 
but are
(gtk.CellRendererToggle object, row_num)

In case anyone else is using this.

On Thu, Mar 06, 2003 at 10:56:53PM -0800, David M. Cook wrote:
 On Thu, Mar 06, 2003 at 11:40:03PM -0700, Jay Graves wrote:
 
  self.col2.connect('toggled',self.toggle)
 
 You want to connect to the renderer, not the column:
 
 cell = gtk.CellRendererToggle()
 cell.connect(toggled, self.toggle)
 self.col2 = gtk.TreeViewColumn(allow,gtk.CellRendererToggle(),active=2)
 
 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/

-- 

Jay Graves 
[EMAIL PROTECTED]
jay.skabber.com

   O__
  _/`.\
  `=( '



pgp0.pgp
Description: PGP signature


[pygtk] window id

2003-03-07 Thread John Hunter

I am trying to make a vtk renderwindow for pygtk2.  The code I am
using as my starting point makes a call

def OnRealize(self, *args):
if self.__Created == 0:
# you can't get the xid without the window being realized.
self.realize()
win_id = str(self.window.xid)
self._RenderWindow.SetWindowInfo(win_id)
self.__Created = 1
return gtk.TRUE

self extends gtk.Window

But this 'xid' attribute appears to no longer exist.  Is there a way
to get a window ID, preferably in a cross platform way?

Thanks,
John Hunter

pygtk 1.99.15
___
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] TreeList check boxes

2003-03-07 Thread Jay Graves
I just wanted to fix my mistake here for posterity.
the model is passed as a 3rd param if you pass the model when you
connect to the renderer.

the pygtk examples are my friend.

On Fri, Mar 07, 2003 at 01:20:29PM -0700, Jay Graves wrote:
 Oops I guess I should have read James' reply a bit more thoroughly.
 Thanks for putting me on the right track.  Just for the record the args
 passed back when the toggle is clicked are not
 (cell, path_string, model) 
 but are
 (gtk.CellRendererToggle object, row_num)
 



-- 

Jay Graves 
[EMAIL PROTECTED]
jay.skabber.com

   O__
  _/`.\
  `=( '



pgp0.pgp
Description: PGP signature


Re: [pygtk] window id

2003-03-07 Thread John K Luebs
On Fri, Mar 07, 2003 at 04:25:03PM -0600, John Hunter wrote:
 
 I am trying to make a vtk renderwindow for pygtk2.  The code I am
 using as my starting point makes a call
 
 def OnRealize(self, *args):
 if self.__Created == 0:
 # you can't get the xid without the window being realized.
 self.realize()
 win_id = str(self.window.xid)
 self._RenderWindow.SetWindowInfo(win_id)
 self.__Created = 1
 return gtk.TRUE
 
 self extends gtk.Window
 
 But this 'xid' attribute appears to no longer exist.  Is there a way
 to get a window ID, preferably in a cross platform way?


The concept of a window ID is not cross platform so I think a cross
platform method is misleading. GDK has two macros: GDK_WINDOW_XID and
GDK_WINDOW_HWND. I'm not familiar with the FB stuff. This will expose
attributes: xid and hwnd that will do the proper conversion and return
them in a Python long.

Try the patch below.

Is it possible to get this feature added to PyGTK?

--jkl

--- pygtk-1.99.15/gtk/gdk.override.orig 2003-03-07 15:12:46.0 -0500
+++ pygtk-1.99.15/gtk/gdk.override  2003-03-07 15:33:16.0 -0500
@@ -15,6 +15,12 @@
 #  include Numeric/arrayobject.h
 #endif
 
+#if defined(GDK_WINDOWING_X11)
+#include gdk/gdkx.h
+#elif defined(GDK_WINDOWING_WIN32)
+#include gdk/gdkwin32.h
+#endif
+
 extern PyTypeObject PyGtkWidget_Type;
 
 %%
@@ -1844,6 +1850,30 @@
 return Py_None;
 }
 %%
+override-slot GdkWindow.tp_getattr
+PyObject *
+_wrap_gdk_window_tp_getattr(PyGObject *self, char *attr)
+{
+GdkWindow *window = GDK_WINDOW(self-obj);
+
+#if defined(GDK_WINDOWING_WIN32)
+if (!strcmp(attr, hwnd)) {
+   return PyLong_FromVoidPtr(GDK_WINDOW_HWND(window));
+}
+#elif defined(GDK_WINDOWING_X11)
+if (!strcmp(attr, xid)) {
+   return PyLong_FromUnsignedLong(GDK_WINDOW_XID(window));
+}
+#endif
+
+{
+   PyObject *name = PyString_FromString(attr);
+   PyObject *ret = PyObject_GenericGetAttr((PyObject *)self, name);
+   Py_DECREF(name);
+   return ret;
+}
+}
+%%
 override gdk_window_get_geometry noargs
 static PyObject *
 _wrap_gdk_window_get_geometry(PyGObject *self)


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