How can i look gdk-kesysm codes from python

2007-07-17 Thread Ravi kumar Singh
I am using pygtk and want to use key-press events. i have seen all the keycodes 
in gdk/gdkkeysyms.h but i want to use them in python.

i have seen the py-gtk documentation but i am unable to find out the exact 
class those keycodes are members of

Currently i have only one choicei make a separate program and lookup the 
key-code value by displaying the keycode of the pressed key...and then i use 
that number in my program..but this awkward !!

please tell me which is the exact-class which the keycodes are members 
of...then i would be able to easily lookup its members with :

dir(classname)

   
-
 Get the freedom to save as many mails as you wish. Click here to know how.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How can i look gdk-kesysm codes from python

2007-07-17 Thread Gian Mario Tagliaretti
2007/7/17, Ravi kumar Singh [EMAIL PROTECTED]:

Hi Ravi,

 I am using pygtk and want to use key-press events. i have seen all the 
 keycodes in gdk/gdkkeysyms.h but i want to use them in python.

[...]

 please tell me which is the exact-class which the keycodes are members 
 of...then i would be able to easily lookup its members with :

http://svn.gnome.org/viewcvs/pygtk/trunk/gtk/keysyms.py?revision=2434view=markup

 dir(classname)

gtk.keysyms

cheers
-- 
Gian Mario Tagliaretti
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Get position of cursor in widget?

2007-07-17 Thread Cédric Lucantis
Le lundi 16 juillet 2007 12:50, charlesvpacker a écrit :
 I'm a GTK newbie who has successfully taken the very first
 steps toward building a custom image processing application.
 I've figured out how to read and display an image using
 a GtkImage and GtkPixbuf. I've also modified a block of pixels
 in the existing pixbuf and updated the displayed image
 via gtk_image_set_from_pixbuf. Now I want to get the pixel
 position of the mouse cursor resting on the image. I don't recall
 seeing a GTK tutorial on capturing pointer position or motion.
 Could somebody, um, point me to one?


If you want this from within a mouse event handler, you can use the 
(x,y) and (x_root,y_root) members provided by all the mouse event 
types. The first pair gives the position of the mouse relative to the 
event window and the second the position relative to the screen origin. 

If you're not in a handler, you still have gdk_window_get_pointer() and 
gdk_display_get_pointer(). See the Gdk reference manual for more infos 
(sections 'Event structures', 'Windows' and 'Display').

-- 
Cédric Lucantis
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gthread vs pthread

2007-07-17 Thread Gregory Hosler
Hi,

I've got a gtk+ application that needs a few threads put in it, to open up some
bottlenecks.

My question is whether I should go pthreads, or gthreads.

I've played a bit with pthreads, so I have some familiarity with it. I'm 
wondering:

- whether pthreads and gthreads can co-exist in the same application

- is there any benefit of one vs the other ? (no flames, just
  looking for information here...)

- are there any known issues with pthreads in a gtk+ application?

thoughts, comments, pointers on the above appreciated.

-Greg

-- 
+-+

Please also check the log file at /dev/null for additional information.
(from /var/log/Xorg.setup.log)

| Greg Hosler   [EMAIL PROTECTED]|
+-+

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gthread vs pthread

2007-07-17 Thread Tristan Van Berkom
On Tue, 2007-07-17 at 21:20 +0800, Gregory Hosler wrote:
 Hi,
 
 I've got a gtk+ application that needs a few threads put in it, to open up 
 some
 bottlenecks.
 
 My question is whether I should go pthreads, or gthreads.
 
 I've played a bit with pthreads, so I have some familiarity with it. I'm 
 wondering:
 
   - whether pthreads and gthreads can co-exist in the same application
 
   - is there any benefit of one vs the other ? (no flames, just
 looking for information here...)
 
   - are there any known issues with pthreads in a gtk+ application?
 
 thoughts, comments, pointers on the above appreciated.

Just use GThread, it uses pthread internally and is used throughout the
gtk+ code itself, the worst mistake you could make here I suppose
is to just go pthreading away and expect gtk+ to know whats going on.

Cheers,
-Tristan


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How do I remove the close button from a window in Fedora Core 5?

2007-07-17 Thread Michael Ekstrand
On Tue, Jul 17, 2007 at 08:44:40AM -0700, Jonathan Cooper wrote:
 I am not sure why, but the GTK_WIDGET (window)-window is false (which
 I suspect means I am actually getting a NULL value for
 g_type_instance_cast() which is used by the GTK_WIDGET macro).  Since
 the Gtk::Window::gobj() function returns a GtkWindow*, I do not
 understand why this is failing.  I would appreciate any advice on what I
 am doing wrong...or if there is an easier way to do this.

It means that, for whatever reason, your GTK widget doesn't yet have a
GDK window.  Looking at the source code for GtkWindow reveals that it
doesn't get a window until it is realized.  So you probably want to do
the set_functions call in a realize signal handler.

- Michael
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Graphing widget (oscilloscope-like)?

2007-07-17 Thread david . hagood
Disclaimer: I am new to GTK programming.

I'm looking for a widget which can display an oscilloscope-like display:
that is, a drawable surface with an overlaid graticule of horizontal and
vertical lines, plus zero or more traces consisting of a set of connected
line segments defined by an array of (x,y) pairs. Ideally other things
should be drawable to the surface (e.g. limit lines, markers, annotating
text, filled polygons (limit masks)).

The GTK curve object looks pretty close to what I need, but it is marked
as deprecated.

(I'm about to use bad language here, be forewarned): the license is
important, as this will be going into code that is, unfortunately,
proprietary - as such GPL is out, but LGPL is acceptable.

It seems to me that a graphing widget (which is really what I need) ought
to be something of common enough interest to be available, but I've not
been able to find one.

Failing the availability of such a beast, I'll have to write one (which I
would try to get licensed under LGPL - I don't think my bosses would have
a problem with that). If that happens, does anybody have any good pointers
for writing an efficient line-drawing widget (e.g. should I draw the
graticule once to an offscreen bitmap and then blit that to the drawable
when I refresh, or would it be faster to keep the graticule as a set of
pre-defined line segments and just redraw them each refresh)? Does anybody
else have need for such a thing and suggestions on what they'd like to
see?


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: How do I remove the close button from a window in Fedora Core5?

2007-07-17 Thread Jonathan Cooper
Thank you very much, Michael!   That did the trick.  It was rather
simple, I just didn't expect that the window wasn't realized since this
same code worked fine on FC6.  I just had to connect to
signal_realize...and then put the code to remove the close button into
the signal handler.

Thanks again,
Jonathan


-Original Message-
From: Michael Ekstrand [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 17, 2007 12:00 PM
To: Jonathan Cooper
Cc: gtk-app-devel-list@gnome.org
Subject: Re: How do I remove the close button from a window in Fedora
Core5?

On Tue, Jul 17, 2007 at 08:44:40AM -0700, Jonathan Cooper wrote:
 I am not sure why, but the GTK_WIDGET (window)-window is false 
 (which I suspect means I am actually getting a NULL value for
 g_type_instance_cast() which is used by the GTK_WIDGET macro).  Since 
 the Gtk::Window::gobj() function returns a GtkWindow*, I do not 
 understand why this is failing.  I would appreciate any advice on what

 I am doing wrong...or if there is an easier way to do this.

It means that, for whatever reason, your GTK widget doesn't yet have a
GDK window.  Looking at the source code for GtkWindow reveals that it
doesn't get a window until it is realized.  So you probably want to do
the set_functions call in a realize signal handler.

- Michael


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gthread vs pthread

2007-07-17 Thread Chris Vine
On Tue, 2007-07-17 at 09:53 -0400, Tristan Van Berkom wrote:
 On Tue, 2007-07-17 at 21:20 +0800, Gregory Hosler wrote:
  Hi,
  
  I've got a gtk+ application that needs a few threads put in it, to open up 
  some
  bottlenecks.
  
  My question is whether I should go pthreads, or gthreads.
  
  I've played a bit with pthreads, so I have some familiarity with it. I'm 
  wondering:
  
  - whether pthreads and gthreads can co-exist in the same application
  
  - is there any benefit of one vs the other ? (no flames, just
looking for information here...)
  
  - are there any known issues with pthreads in a gtk+ application?
  
  thoughts, comments, pointers on the above appreciated.
 
 Just use GThread, it uses pthread internally and is used throughout the
 gtk+ code itself, the worst mistake you could make here I suppose
 is to just go pthreading away and expect gtk+ to know whats going on.

If you know that the gthread implementation is a pthreads one (ie the
program is not running on Windows) there is absolutely no problem at all
in using pthreads in the program directly, and there are some things you
can do in pthreads and not in gthreads which mean that you might want to
do that.

Chris


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Fonts problem

2007-07-17 Thread Matthew Jiang
Hi,

When I ran GTK demo application on my ARM board, I got this error message
and the application crashed:

(buttons:159): Pango-WARNING **: No builtin or dynamically
loaded modules were found. Pango will not work correctly.
This probably means there was an error in the creation of:
  '/Gtk_dk/etc/pango/pango.modules'
You should create this file by running pango-querymodules.
Fontconfig error: Cannot load default config file
No fonts found; this probably means that the fontconfig
library is not correctly configured. You may need to
edit the fonts.conf configuration file. More information
about fontconfig can be found in the fontconfig(3) manual
page and on http://fontconfig.org


I tried to copy some fonts (like /usr/share/fonts/bitstream-vera) from my
linux
host to my target. It works with crash. However, the characters do not
display correctly.

Could anybody tell me how to solve this problem?

Thank you,

Matthew
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Fonts problem

2007-07-17 Thread Luis A. Montes
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew Jiang wrote:
 Hi,
 
 When I ran GTK demo application on my ARM board, I got this error message
 and the application crashed:
 
 (buttons:159): Pango-WARNING **: No builtin or dynamically
 loaded modules were found. Pango will not work correctly.
 This probably means there was an error in the creation of:
   '/Gtk_dk/etc/pango/pango.modules'
 You should create this file by running pango-querymodules.
 Fontconfig error: Cannot load default config file
 No fonts found; this probably means that the fontconfig
 library is not correctly configured. You may need to
 edit the fonts.conf configuration file. More information
 about fontconfig can be found in the fontconfig(3) manual
 page and on http://fontconfig.org
 
 
 I tried to copy some fonts (like /usr/share/fonts/bitstream-vera) from my
 linux
 host to my target. It works with crash. However, the characters do not
 display correctly.
 
 Could anybody tell me how to solve this problem?
 
 Thank you,
 
 Matthew
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
I had a similar problem, albeit in a more prosaic environment:
WindowsXP. The catch is that I wanted to install the minimum GTK+ and I
wanted to do it from my own installer, I didn't want the end user to
have to install GTK+. You probably didn't run the GTK+ installer either?
I found out that I could make it behave if I created:
/program-root-+-etc-+-fonts
  |  +-pango-+-pango.aliases
  |   +-pango.modules
  +-lib-pango-1.5.0-modules-+-pango-basic-fc.dll
+-pango-basic-win32.dll
Of course, YMMV and I had the advantage of being able to install in
other computer and then just copy the same files over to the installer.

This might be a no-no if the system already has GTK+ installed, I just
happen to know that they didn't have it and that they were unlikely to
want to go through two installers to get my program running.

Hope it helps
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnYI6J4+d0CQL2bIRAlOyAJ9PbJIGpfXA+stkj7R4tI7qsEpXDwCgyKZs
YpJYc18WzSVXg87Bd9ZANTI=
=5Ctn
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


g_io_win32_dispatch yields condition=0

2007-07-17 Thread Dov Grobgeld

I'm investigating a problem under windows that appears to be a missed event.


My test viewer application is built as follows:

1. A top level widget with a GtkImage widget that shows an image.
2. The program also listens to http requests through the gnet library and
allows to remote control the gui to change the image being displayed.

I can now connect to this viewer by a client and request it to change the
image being displayed. Everything is working nicely except if the
application is busy (see below) when the image change request arrives. To
make the viewer busy I take hold on corner of the top level widget and start
resizing the widget back and forth. If, when doing the resizing, a http
request arrives it is not passed on to my callback routine.

The problem is the call to the GIOFunc from the g_io_win32_dispatch
function. Normally I get GIOCondition=4 when data is ready to read on my gtk
condition, and GIOCondition=5 when data can be written. But if I do the
resizing trick when the data arrives, I instead get a call with
GIOCondition=0, even though I should have got GIOCondition=4 since there is
data to read on the socket. This in turn fails the following the following
test in the gnet callback function:

 if (condition  G_IO_IN)

I never get any additional callback and my client is timeout since it never
gets any reply.

Does anyone have any idea of what is wrong, or what additional tests I can
do to help debugging this issue?

Thanks!
Dov
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


glib2 and pthread on solaris

2007-07-17 Thread Michael Weiser
Hi there,

how well tested is the following part of recent (=2.11) glib's
configure?

  *-solaris*)
# These compiler/linker flags work with both Sun Studio and gcc
# Sun Studio expands -mt to -D_REENTRANT and -lthread
# gcc expands -pthreads to -D_REENTRANT -D_PTHREADS -lpthread
G_THREAD_CFLAGS=-D_REENTRANT -D_PTHREADS
G_THREAD_LIBS=-lpthread -lthread
;;

On Solaris 10 SPARC64 with binutils-2.17 and gcc-4.2.0 in 64bit mode
(configured for target sparc64-sun-solaris2.10 without multilib) this
leads to the following error message:

gmake[3]: Entering directory `/var/tmp/glib-2.13.7/tests/refcount'
/bin/bash ../../libtool --mode=link gcc  -O2 -pipe -I/usr/local/include
-Wall  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -o closures
closures.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -lpthread -lthread -lrt -lrt

gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o  -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lpthread -lthread -lrt
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/libiconv-1.11/lib /usr/local/binutils-2.17/bin/ld:
../../gthread/.libs/libgthread-2.0.so: pthread_mutex_unlock: invalid
version 2 (max 0) ../../gthread/.libs/libgthread-2.0.so: could not read
symbols: Bad value collect2: ld returned 1 exit status

../../libtool: line 5179: 25307 Segmentation Fault  (core dumped)
gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lpthread -lthread -lrt
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/libiconv-1.11/lib

gmake[3]: *** [closures] Error 139


When removing the above section it compiles cleanly using:

/bin/bash ../../libtool --mode=link gcc  -O2 -pipe -I/usr/local/include
-Wall  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -o closures
closures.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -pthread -lrt -lrt

gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o -pthread  -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lrt -Wl,--rpath
-Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/libiconv-1.11/lib

creating closures

Additional information:

[EMAIL PROTECTED] refcount]$ ld -V
GNU ld version 2.17
  Supported emulations:
   elf64_sparc
   elf32_sparc
[EMAIL PROTECTED] refcount]$ gcc -v
Using built-in specs.
Target: sparc64-sun-solaris2.10
Configured with: ../configure --prefix=/usr/local/gcc-4.2.0
--enable-threads --disable-shared --disable-nls --enable-languages=c,c++
--with-gnu-ld --with-ld=/usr/local/binutils-2.17/bin/ld --with-gnu-as
--with-as=/usr/local/binutils-2.17/bin/as --with-cpu=ultrasparc
--disable-multilib --target=sparc64-sun-solaris2.10
--build=sparc64-sun-solaris2.10 --host=sparc64-sun-solaris2.10
Thread model: posix
gcc version 4.2.0
-- 
bye, Micha
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How Tab brings widgets into focus

2007-07-17 Thread Daniel Kasak
On Tue, 2007-07-17 at 22:25 -0700, varun_shrivastava wrote:

 hi
 i tried to find out how pressing Tab key brings widgets into focus, but
 couldn;t find out.
 
 For eg if i have created three spin button widget and are held by a
 container VBox.
 then pressing tab key switches b/w the spin buttons. I looked through the
 source code of gtkspinbutton, but couldn't find where key press event
 related to Tab key is being handled.

This behaviour probably ( I'm guessing a bit here ) inherits from
GtkWidget.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How Tab brings widgets into focus

2007-07-17 Thread Yeti
On Tue, Jul 17, 2007 at 10:25:42PM -0700, varun_shrivastava wrote:
 
 i tried to find out how pressing Tab key brings widgets into focus, but
 couldn;t find out.

Start at the end of gtk_window_class_init() where
add_arrow_bindings() and add_tab_bindings() are called and
follow from there...  it should lead you to places such as
gtk_container_focus().

Yeti

--
http://gwyddion.net/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


GTK-Warning when trying to open a map of geodata from a database.

2007-07-17 Thread Daniela Stärke
Hi everyone,

when I want to open a database with geometry data in it with the program 
MezoGis I receive the following GTK-Warning:

/usr/local/lib/python2.5/site-packages/mezoGISlib/_canvas.py:530: GtkWarning: 
Using Cairo rendering requires the drawable argument to
have a specified colormap. All windows have a colormap,
however, pixmaps only have colormap by default if they
were created with a non-NULL window argument. Otherwise
a colormap must be set on them with gdk_drawable_set_colormap
  self.ctx = self.pixmap.cairo_create() 
Traceback (most recent call last):
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_pane_db.py, line 
537, in __on_doubleclick
self.pgbutler.runQuery('SELECT * FROM %s'%table.getSQL())
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_guicore.py, line 
412, in runQuery
self.showResults(cursor, query, layer, resultset, tablelist)
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_guicore.py, line 
446, in showResults
mapview = openMapView(layer.resultset)
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_guiwindows.py, line 
33, in openMapView
m = MapWindow(resultset)
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_guiwindows.py, line 
139, in __init__
self.canvas = MapCanvas()
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_canvas.py, line 86, 
in __init__
self.__createNewCanvas()
  File /usr/local/lib/python2.5/site-packages/mezoGISlib/_canvas.py, line 
530, in __createNewCanvas
self.ctx = self.pixmap.cairo_create() 
cairo.Error: NULL pointer

A mapframe is also created, but somehow there is no content in it or nothing is 
shown on/in the map.
I am nearly for 100% sure, that there is no mistake in my geometry data, 
because the extend is correct initialized, when I start the database.

Has anyone an idea, what I could do??? I am totally desperate, because the 
program will not work.


 In the source code I made some print-commands, to see how far the program goes 
and there I saw, that mezogis goes in the file _canvas.py and also in the 
function  def __createNewCanvas(self): . But then, when mezogis should show 
the extend (with a print command) of the table, I get height: 1 and width: 1. 
And this can't be right, because my database is filled with geodata of the 
world, and this extend can't be just 1.

Something must be wrong with the line:

aw = self.mapframe.get_allocation()
because afterwards the height and width is set, and with print I get the extend 
of 1, like I said.
The get_allocation command is a method of python, or what does it do???  I ask, 
because in no other file this method is used (ok, just in one of 
_guiwindows.py, but there, the line is commented out).

When I use the SQL-command (Select * from public.dbname )to show me the 
content of the database I get the messages which I wrote above.
The program is able to show all data in a table, except from the 
geometry-column. But actually I wanted a map created, which looks like a 
worldmap and with which I could work, but without mezogis is quit useless for 
me.

Also with a database of randomized created geometry data I have the same 
problem.

Thank you very much in advance for your help.

Daniela

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Compile errors for gtk+ 2.10.13 on Solaris 10 11/06

2007-07-17 Thread Alan Pae
See http://www.haible.de/bruno/gettext-FAQ.html#integrating_undefined
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: ProgressBar set_text

2007-07-17 Thread Wouter Verhelst
On Tue, Jul 17, 2007 at 10:16:30AM +0200, Jeffrey Ratcliffe wrote:
 I have a ProgressBar tracking a forked process below. There is
 presently a debugging line
 
 print $1 $2\n;
 
 With this left in, the text in the ProgressBar is updated OK. Without
 the print statement, the text is not updated.
 
 What is going on?
[...]
 sub sig_child {
   my $pid = wait;
   if ($pid = 0) {
   delete $helperTag{$pid};
  }
 }
[... other indentation mistakes ...]

Oh, for the love of God, if you want other people to look at your code
then please make it readable. That *includes* having proper
indentation. Having to look at such messy code just made my eyes bleed.

That being said,

if ($condition  'in') { # bit field operation. = would also work
 my $line = $reader;
 if ($line =~ /(\d*\.?\d*)(.*)/) {
 print $1 $2\n;
  $pbar-set_fraction($1);
  $pbar-set_text($2);
 }
}

directly using values which you extract using a regex like that has
issues with glib (it wants to have modifiable variables, which these
things aren't). Try assigning them to temporary variables before going
on:

if($line =~ /(\d*\.?\d*)(.*)/) {
my $fraction=$1;
my $text=$2;
$pbar-set_fraction($fraction);
$pbar-set_text($text);
}

Also, I don't think fractional values are allowed for a progress bar.

-- 
Wouter Verhelst
NixSys BVBA
Louizastraat 14, 2800 Mechelen
T: +32 15 27 69 50 / F: +32 15 27 69 51 / M: +32 486 836 198
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: ProgressBar set_text

2007-07-17 Thread Jeffrey Ratcliffe
On 17/07/07, Wouter Verhelst [EMAIL PROTECTED] wrote:
 directly using values which you extract using a regex like that has
 issues with glib (it wants to have modifiable variables, which these
 things aren't). Try assigning them to temporary variables before going
 on:

 if($line =~ /(\d*\.?\d*)(.*)/) {
 my $fraction=$1;
 my $text=$2;
 $pbar-set_fraction($fraction);
 $pbar-set_text($text);
 }

Your modification works. Thanks. I don't understand then why it worked
with the print statement.

Regards

Jeff
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list