[pygtk] How to size a TextView? Any suggestions?

2006-06-01 Thread Charles D Hixson
I'm trying to place a textview into a scrolled window (inside of either
an HBox or a Table), and running into the problem that the window is
unreasonably narrow.  Even if I attach it into a Table and tell the
table.attach(sw, 1, 6, 0, 4) while the pane is sufficiently wide, the
text entered in that pane is about 8-10 characters wide...then it will
wrap, or disappear off the edge.  And if one looks below, one notices
that the horizontal scrollbar is only as wide as the text...so the
scrolled window seems to be the culprit.

Strangely enough, if I build this in Glade, and specify width to make
the panel wide enough, then when I compile it the first column (a button
bar) is hidden...presumably beneath the scrolled window.  This was just
a test, so there wasn't any data in it to check for wrapping.  (I
planned to look at the C code to figure out what to tell pyGtk, but it
was worse than the tests from python.)  Gazpatcheo appears to generate a
reasonable file, but the Glade file looks good from within Glade, also. 
Besides, that file uses an attribute, thus: property
name=width_request344/property, and none of the documentation I've
encountered defines what that would do.

I'd include the code, but it's a bit verbose for a mailing list for even
a simple case.  Also, I've tried several different things, and detailing
that 


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


Re: [pygtk] How to size a TextView? Any suggestions?

2006-06-01 Thread Sandro Dentella
On Thu, Jun 01, 2006 at 01:38:06AM -0700, Charles D Hixson wrote:
 I'm trying to place a textview into a scrolled window (inside of either
 an HBox or a Table), and running into the problem that the window is
 unreasonably narrow.  Even if I attach it into a Table and tell the
 table.attach(sw, 1, 6, 0, 4) while the pane is sufficiently wide, the
 text entered in that pane is about 8-10 characters wide...then it will

 I'd include the code, but it's a bit verbose for a mailing list for even
 a simple case.  Also, I've tried several different things, and detailing
 that 

Can't you try and create a simple example of the problem you have? I
personally find it really difficult to help you w/o a code to read even
thouht I don't normally have problems w/ TextView dimentions... 

*:-)

-- 
Sandro Dentella  *:-)
http://www.tksql.orgTkSQL Home page - My GPL work
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] how to get a handler list for a signal?

2006-06-01 Thread Sandro Dentella
Hi all,

   how can I get a list of handlers attached to a widget with the relative
   signals? 

   I have looked throughtout the docs but I only see how to block or
   disconnect by id, not a way to get the ids...

   If I have an id is there a way to query wich is the signal it is attached
   to and which is the handler?

   Thanks
   sandro
   *:-)


-- 
Sandro Dentella  *:-)
e-mail: [EMAIL PROTECTED] 
http://www.tksql.orgTkSQL Home page - My GPL work
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Question about building PyGTK 2.8.6 on Linux

2006-06-01 Thread Tom Williams

Tom Williams wrote:
Hi!  I'm trying to build PyGTK 2.8.6 on Linux (Slackware 8-based 
system w/ custom mods) and even though it builds, I don't think it's 
building correctly.

During the build, I get messages like this:

-START---

make[2]: Leaving directory `/home/tom/build/pygtk-2.8.6/gobject'
Making all in .
make[2]: Entering directory `/home/tom/build/pygtk-2.8.6'
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. 
-I/usr/include/python2.4 -pthread -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -I./gobject
-I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atkmodule.lo -MD -MP -MF 
.deps/atk_la-atkmodule.Tpo -c -o atk_la-atkmodule.lo `test -f 
'atkmodule.c' || echo './'`atkmodule.c; \
then mv -f .deps/atk_la-atkmodule.Tpo .deps/atk_la-atkmodule.Plo; 
else rm -f .deps/atk_la-atkmodule.Tpo; exit 1; fi

mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/python2.4 -pthread 
-I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include 
-I./gobject -I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atkmodule.lo -MD -MP -MF 
.deps/atk_la-atkmodule.Tpo -c atkmodule.c  -fPIC -DPIC -o 
.libs/atk_la-atkmodule.o

(cd .\
 /usr/bin/python codegen/codegen.py \
   --register pango-types.defs \
   --register atk-types.defs \
   --override atk.override \
   --prefix pyatk atk.defs)  gen-atk.c \
 cp gen-atk.c atk.c \
 rm -f gen-atk.c
Could not write method AtkObject.connect_property_change_handler: No 
ArgType for 'AtkPropertyChangeHandler*'
Could not write method AtkObject.notify_state_change: No ArgType for 
'AtkState'

Warning: generating old-style constructor for atk_no_op_object_new
Could not write method AtkRelation.get_target: No ArgType for 
'GPtrArray*'
Could not write method AtkStateSet.add_states: No ArgType for 
'AtkStateType*'
Could not write method AtkStateSet.contains_states: No ArgType for 
'AtkStateType*'
Could not write function add_focus_tracker: No ArgType for 
'AtkEventListener'
Could not write function focus_tracker_init: No ArgType for 
'AtkEventListenerInit'
Could not write function add_global_event_listener: No ArgType for 
'GSignalEmissionHook'
Could not write function add_key_event_listener: No ArgType for 
'AtkKeySnoopFunc'

Warning: Constructor for AtkNoOpObject needs to be updated to new API
See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
Warning: Constructor for AtkRelation needs to be updated to new API
See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
***INFO*** The coverage of global functions is 77.78% (14/18)
***INFO*** The coverage of methods is 89.58% (43/48)
***INFO*** There are no declared virtual proxies.
***INFO*** There are no declared virtual accessors.
***INFO*** There are no declared interface proxies.
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. 
-I/usr/include/python2.4 -pthread -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -I./gobject
-I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atk.lo -MD -MP -MF 
.deps/atk_la-atk.Tpo -c -o atk_la-atk.lo `test -f 'atk.c' || echo 
'./'`atk.c; \
then mv -f .deps/atk_la-atk.Tpo .deps/atk_la-atk.Plo; else rm -f 
.deps/atk_la-atk.Tpo; exit 1; fi

make[2]: *** [atk_la-atk.lo] Interrupt
make[1]: *** [all-recursive] Interrupt
make: *** [all] Interrupt


real4m7.936s
user0m57.852s
sys 0m6.644s
[EMAIL PROTECTED]:~/build/pygtk-2.8.6$

--END--

My environment:

Linux 2.6.16.16.kernel
glibc 2.4
gcc 4.1.1
glib 2.8.6
gtk+ 2.8.18
atk 1.10.3
pango 1.10.4
cairo 1.0.4
python 2.4.3


I tried looking at the URLs referenced above 
(http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors), but 
that section (update-constructors) doesn't exist in the referenced 
page (looks like a Wiki page).   The messages like that don't prevent 
the build from stopping (I terminated the above example) and when I 
run make check, I get this:


START

Making check in examples
make[1]: Entering directory `/home/tom/build/pygtk-2.8.6/examples'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/tom/build/pygtk-2.8.6/examples'
Making check in tests
make[1]: Entering directory `/home/tom/build/pygtk-2.8.6/tests'
make  check-local
make[2]: Entering directory `/home/tom/build/pygtk-2.8.6/tests'
WARNING: gtk could not be imported
WARNING: gtk.gdk could not be imported
WARNING: gtk.glade could not be imported
Traceback (most recent call last):
 File ./runtests.py, line 41, in ?
   suite.addTest(loader.loadTestsFromName(name))
 File /usr/lib/python2.4/unittest.py, line 524, in loadTestsFromName
   module = __import__('.'.join(parts_copy))
 File 

Re: [pygtk] how to get a handler list for a signal?

2006-06-01 Thread Charles D Hixson
Sandro Dentella wrote:

  On Thu, Jun 01, 2006 at 01:38:06AM -0700, Charles D Hixson wrote:

   
  I'm trying to place a textview into a scrolled window (inside of either
  an HBox or a Table), and running into the problem that the window is
  unreasonably narrow.  Even if I attach it into a Table and tell the
  table.attach(sw, 1, 6, 0, 4) while the pane is sufficiently wide, the
  text entered in that pane is about 8-10 characters wide...then it will
  
 
 

   
  I'd include the code, but it's a bit verbose for a mailing list for even
  a simple case.  Also, I've tried several different things, and detailing
  that 
  
 
 
  Can't you try and create a simple example of the problem you have? I
  personally find it really difficult to help you w/o a code to read even
  thouht I don't normally have problems w/ TextView dimentions... 
 
  *:-)
   
Understood.  Well, I can boil it down THIS far:




#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk

class   GuiWindow:


def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
#window =   self.window ##  **!!**  delete 
this later
self.window.set_name (Test Input)

#   build the button bar
vbox2   =   gtk.VBox()
#self.table.attach(vbox, 0, 1, 0, 3)

# .. A Run button
self.runButton = gtk.Button(Run)
vbox2.pack_start(self.runButton, expand = False, fill = False, 
padding = 0)
self.runButton.show()

# .. A Reset button
self.resetButton = gtk.Button(Reset)
self.resetButton.show()

# .. And a quit button
button = gtk.Button(Quit)
vbox2.pack_end(button, expand = False, fill = True, padding = 0)
button.connect_object(clicked, lambda w: w.destroy(), 
self.window)
button.show()

hbox=   gtk.HBox()
hbox.pack_start (vbox2, expand = True, fill = True, padding = 0)

sw  =   gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
textview=   gtk.TextView()
#textview.set_wrap_mode(gtk.WRAP_WORD)
self.textbuffer =   textview.get_buffer()
sw.add(textview)
sw.show()
#self.table.attach(sw, 1, 6, 0, 4)
vboxsw  =   gtk.VBox()
hbox.pack_start (vboxsw, expand = True, fill = True, padding = 
0)
vboxsw.pack_start (sw, expand = True, fill = True, padding = 0)
textview.show()
self.textbuffer.set_text(This is a bunch of stuff entered as 
initial contents)
# Create the drawing area
drawing_area = gtk.DrawingArea()
drawing_area.set_size_request(200, 200)
hbox.pack_start (drawing_area, expand = True, fill = True, 
padding = 0)

vbox1   =   gtk.VBox()
vbox1.pack_start(hbox,  expand = True, fill = True, 
padding = 0)
hbox.show()


self.window.connect(destroy, lambda w: gtk.main_quit())

drawing_area.show()
self.window.add(vbox1)
vbox1.show()

self.window.show_all()

def main(self):
gtk.main()

return 0

if __name__ == __main__:
g   =   GuiWindow()
g.main()

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