(GObject) What are properties?

2003-11-19 Thread dhaude
Hi all,

what are the properties of GObjects, how are they used, and how
are they different from the things that can be stored/retrieved
via g_object_set/get_data() ? I've once tried, just for giggles,

g_object_set(G_OBJECT(some_gtk_widget), foo, bar, NULL);

and got a segfault. Little wonder, considering that the
documentation in the API reference reads thus:

void g_object_set(gpointer object,
  const gchar *first_property_name,
  ...);
object :
first_property_name :
... :

Which brings me to the point, is anybody working on the
documentation of GObject at all? Of course I know this is all
open source stuff, written and maintained by volunteers, so I'm
far from complaining about lack of documentation. Just curious.

--Daniel

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (GObject) What are properties?

2003-11-19 Thread Sven Neumann
Hi,

[EMAIL PROTECTED] writes:

 what are the properties of GObjects, how are they used, and how
 are they different from the things that can be stored/retrieved
 via g_object_set/get_data() ? I've once tried, just for giggles,
 
 g_object_set(G_OBJECT(some_gtk_widget), foo, bar, NULL);
 
 and got a segfault.

Does your object some_gtk_widget have a property named foo that
takes a string value? If not, it is not surprising that the call
fails. It's a bit surprising that it crashes; I'd have expected a
warning.

 Which brings me to the point, is anybody working on the
 documentation of GObject at all? Of course I know this is all open
 source stuff, written and maintained by volunteers, so I'm far from
 complaining about lack of documentation. Just curious.

Mathieu is doing a nice job on GObject documentaion. See
http://www.le-hacker.org/papers/gobject/index.html


Sven
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkTreeView alignment

2003-11-19 Thread Manuel Op de Coul
Andrej wrote:
Example: out of the three, only the 1st one gets aligned when the row is
appended with e.g.:

Well according to the documentation the xalign property doesn't
exist for toggle- and pixbuf-renderers.
For pixbufs you could work around it by drawing them into other
ones with equal size.
For toggle buttons it would look strange to align them in the
middle if you ask me.

Manuel



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Problems with compiler-dependent switches in gthread-2.0.pc file

2003-11-19 Thread Greg Earle
Hi,

I'm not sure if this is the right list to ask on (if not, please inform me
what the right one is), but just in case it is ...

I'm trying to upgrade to glib 2.2.3/atk 1.2.4/gtk+-2.2.4/gimp-1.3.22
on Solaris 7.  I'm already using pkg-config 0.15.0.

I'm trying to do this with the following snippet of

http://www.Mozilla.ORG/releases/mozilla1.5/installation-ports.html#ports_solari
s

in mind:

Requires GTK+ and GLib libraries (libraries must be compiled with Sun
 Workshop/Forte.  GTK+/glib compiled with gcc are incompatible with Mozilla
 binaries built with Sun Workshop/Forte; GTK+/glib libraries compiled with Sun
 Workshop/Forte are compatible w/ binaries compiled with both Sun Workshop and
 gcc.  (Mozilla bug 136144, bug 141415, bug 186534 and many others)

So, when I went to build glib 2.2.3, I specified CC=cc, CXX=CC, and F77=f77
to use the Sun Forte Workshop 6.2 compilers instead of gcc 3.3.1, which is
what I normally use.

The configure line I used for glib-2.2.3 was

./configure --enable-threads --with-threads=solaris --enable-static \
--enable-shared --enable-fast-install --with-libiconv=no

It built everything fine and installed fine, but now here's the problem:

My /usr/local/lib/pkgconfig/gthread-2.0.pc now contains

Name: GThread
Description: Thread support for GLib
Requires: glib-2.0
Version: 2.2.3
Libs: -L${libdir} -lgthread-2.0 -mt
Cflags: -mt

Big problem.  -mt is a switch that's only applicable to the Sun Forte 6
compiler!  If I then go back and, say, try to build atk 1.2.4 with gcc 3.3.1,
it dies during the compilation when it hits something that causes
pkg-config --cflags glib-2.0 to be invoked.

I'm looking at workarounds (trying --with-threads=posix, just for fun)
but in the meantime, isn't putting compiler-specific flags into the *.pc
files a Really Bad Idea?  It basically locks you into using whatever the
compiler was that you used to compile glib/gthread/etc. with ... right???

Anyone?  Anyone?  Bueller?

Thanks in advance,

- Greg


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


mover ventanas

2003-11-19 Thread rosa muñoz
Hola:
necesito que alguien me diga como puedo mover una ventana externa a mi 
programa principal.
Yo tengo un boton que al ser pulsado ejecuta un programa independiente a mi 
programa principal.necesito averiguar como puedo colocar esa nueva ventana 
en un lugar determinado de la pantalla.tambien necesito saber como ejecuto 
el nuevo programa yo he probado con system pero a lo mejor no esta bien

Espero vuestra respesta.es para un proyecto de la universidad
rosa
_
Dale rienda suelta a tu tiempo libre. Encuentra mil ideas para exprimir tu 
ocio con MSN Entretenimiento. http://entretenimiento.msn.es/

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (GObject) What are properties?

2003-11-19 Thread dhaude
 Does your object some_gtk_widget have a property named foo that
 takes a string value? If not, it is not surprising that the call
 fails. It's a bit surprising that it crashes; I'd have expected a
 warning.

Ah. No, of course it doesn't have that property, which explains
why my experiment didn't work (and I re-checked; indeed I did get
a warning, and the crash was a follow-up error caused by my
program).

 Mathieu is doing a nice job on GObject documentaion. See
 http://www.le-hacker.org/papers/gobject/index.html

I know; I read it (and also now understood that a property first
must be installed before it can be used to assign values to
it).

I guess I haven't quite wrapped my head around properties, but am
I right in assuming that their main advantages (as opposed to,
say, ordinary class members) are:

1) they are installable at runtime

2) they can emit signals when changed

Am I also right in assuming that each and every GObject carries
around with it two hash tables; one for properties and one for
the get/set_data() functions?

Thanks,
--Daniel

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


leer el id de un programa externo

2003-11-19 Thread rosa muñoz
hola:
necesito saber como puedo leer el id de una ventana externa para luego poder 
moverla tambien necesito saber como moverla.

chao
espero vuestras respuestas
gracias
_
Descubre el mayor catálogo de coches de la Red en MSN Motor. 
http://motor.msn.es/researchcentre/

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: (GObject) What are properties?

2003-11-19 Thread Murray . Cumming
 I guess I haven't quite wrapped my head around properties, 
 but am I right in assuming that their main advantages (as 
 opposed to, say, ordinary class members) are:
 
 1) they are installable at runtime
 
 2) they can emit signals when changed

These are true, though I don't think 1) is that useful. More importantly,
they
3) are introspectable, so a RAD tool (such as Glade) can find out what
properties an object has, without special code for each widget.
4) don't mess with ABI. You can add a property without worrying about
changing the size of the struct. The new private instance data thing in glib
2.3 also does this, howeer.

Murray Cumming
www.murrayc.com
[EMAIL PROTECTED]
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: (GObject) What are properties?

2003-11-19 Thread iain
On Wed, 2003-11-19 at 14:04, [EMAIL PROTECTED] wrote:

  2) they can emit signals when changed
 
 These are true, though I don't think 1) is that useful. 

Two is kinda annoying too, because they always seem to emit signals, and
occasionally that messes up when you start playing around with multiple
threads.

But a subclass wrapper around things that need threadsafe property
notification signals is a quick 118 lines in C if you have your thread
stuff done nicely :)

iain
-- 
Miss Celine Dion sings lovesongs while our cities burn

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (GObject) What are properties?

2003-11-19 Thread Sven Neumann
Hi,

[EMAIL PROTECTED] writes:

 4) don't mess with ABI. You can add a property without worrying
 about changing the size of the struct.

Sorry, but this is not true. The property doesn't provide a place to
store the value, it only provides a way to get and set the value in a
general fashion.

For some nice things you can do based on properties, take a look at
the GimpConfigInterface:
  http://developer.gimp.org/api/1.3/app/app-config-interface.html
GIMP-1.3 uses this for all things that need to have its state stored
in config files. There's also a set of widgets that can be used as
views on object properties:
  http://developer.gimp.org/api/1.3/app/app-gimppropwidgets.html
In the long run we plan to move this functionality out of the GIMP
core into a separate library.


Sven
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: (GObject) What are properties?

2003-11-19 Thread Murray . Cumming
 [EMAIL PROTECTED] writes:
 
  4) don't mess with ABI. You can add a property without 
 worrying about 
  changing the size of the struct.
 
 Sorry, but this is not true. The property doesn't provide a 
 place to store the value, it only provides a way to get and 
 set the value in a general fashion.

Yes, of course. Sorry.

 For some nice things you can do based on properties, take a 
 look at the GimpConfigInterface:
   http://developer.gimp.org/api/1.3/app/app-config-interface.html
 GIMP-1.3 uses this for all things that need to have its state 
 stored in config files. There's also a set of widgets that 
 can be used as views on object properties:
   http://developer.gimp.org/api/1.3/app/app-gimppropwidgets.html
 In the long run we plan to move this functionality out of the 
 GIMP core into a separate library.

Murray Cumming
www.murrayc.com
[EMAIL PROTECTED]
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


GTK TreeView Column Header Colors

2003-11-19 Thread Mike Dailey
Is it possible to change the foreground and background
color of the column header in a GTK TreeView, using a
ListStore as the model?

I found that I can successfully pack a widget (say, a
button with a label) into the column header, and
change the colors of this button/label widget, but it
just doesn't look right since the button does not
expand to fill the entire column header cell.  

Is there an easier way to do this?  As always, any
help is greatly appreciated, and some example code
would be a miracle! :-)

Thanks,

Mike

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Slow Rendering?

2003-11-19 Thread Dennie, Brooke
Hi to all,

I have an application that works perfectly, but rendering is
extremely slow (bringing up the application takes over 8
seconds, a popup window takes a little over 4). While I
realize that it isn't necessarily a guarantee that this is the
problem, stepping through the application with gdb shows that
the bulk of this (4-5 seconds) occurs when I try to show the
top widgets. However, if I take out all changes to the
background colors and fonts, the time drops to 3 seconds to
bring up the applicaton and  1 second for popup windows. I
don't know if changing these via the rc file is faster, but
that option isn't available to me anyway since I won't know
what colors or fonts to use until run-time. Any ideas on
what's going on? I can supply some code if necessary.

Thanks for any help!

Brooke

PS - I'm working on a sparc ultra 5 that runs Solaris 8, BUT
the application is running from a window where I've ssh'd to a
linux terminal that runs redhat 9 with a 2.4.20-18.9 kernel

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


TreeView Functionality Questions

2003-11-19 Thread Mike Dailey
A few questions regarding TreeViews (yes, I read the
FAQs and API documentation)...

Is it possible to add spacing between TreeView
columns?

Is it possible to add a verticle line/seperator
between columns?


Thanks!

-Mike



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


glib compilation problem--undefined references in glib-genmarshal.c

2003-11-19 Thread Alan Arehart

No one knows what this problem is and how to fix it?

- Forwarded by Alan Arehart/US/Raytheon on 11/19/2003 11:05 AM -




Alan Arehart [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
11/17/2003 05:52 PM


To:[EMAIL PROTECTED]
cc:
Subject:glib compilation problem--undefined references in glib-genmarshal.c



Hi, 
I'm having trouble making glib-2.2.3 on Cygwin (Windows 2000). Could someone please help me figure out what I'm doing wrong and tell me how to fix it? 
I have /usr/bin/pkg-config version 0.15.0 and /usr/bin/iconv version 1.9. 
I'm running GNU /usr/bin/make 3.80 from the directory /cygdrive/c/stuff/downloads/glib-2.3.3 after doing a ./configure from that directory with no options specified. 

My environment variables are 
HOMEPATH=\ 
LD_LIBRARY_PATH=/usr/lib:/cygdrive/c/j2sdk1.4.2_02/include:/cygdrive/c/j2sdk1.4.2_02/include/win32:/lib:/usr/local/lib:/usr/lib: 
MANPATH=:/usr/X11R6/man:/usr/ssl/man 
OS2LIBPATH=C:\WINNT\system32\os2\dll; 
PATH=/cygdrive/c/Program\ Files/emacs/emacs-20.7/bin:/cygdrive/c/j2sdk1.4.2_02/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/Program Files/Common Files/Adaptec Shared/System:/cygdrive/c/matlab6p5/bin/win32:/cygdrive/c/j2sdk1.4.2_02/bin:/cygdrive/c/Program Files/emacs/emacs-20.7/bin:/cygdrive/c/apache-ant-1.6beta2/bin:/usr/local/lib:/usr/lib:Z:.:/usr/X11R6/bin: 
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH 
PKG_CONFIG_PATH=:/usr/X11R6/lib/pkgconfig 

The relevant output of the make is ... 
make[2]: Entering directory `/cygdrive/c/stuff/downloads/glib-2.2.3/gobject' 
/bin/bash ../libtool --mode=link gcc -g -O2 -Wall -o glib-genmarshal.exe glib-genmarshal.o ../glib/libglib-2.0.la -lintl  
gcc -g -O2 -Wall -o .libs/glib-genmarshal.exe glib-genmarshal.o ../glib/.libs/libglib-2.0.dll.a -L/usr/lib -luser32 -lkernel32 /usr/lib/libintl.dll.a /usr/lib/libiconv.dll.a -Wl,--rpath -Wl,/usr/local/lib 
glib-genmarshal.o(.text+0x1807): In function `complete_in_arg': 
/cygdrive/c/stuff/downloads/glib-2.2.3/gobject/glib-genmarshal.c:218: undefined reference to `_g_log' 
glib-genmarshal.o(.text+0x1c17): In function `complete_out_arg': 
/cygdrive/c/stuff/downloads/glib-2.2.3/gobject/glib-genmarshal.c:263: undefined reference to `_g_log' 
glib-genmarshal.o(.text+0x1cf5): In function `pad': 
/cygdrive/c/stuff/downloads/glib-2.2.3/gobject/glib-genmarshal.c:283: undefined reference to `_g_free' 
glib-genmarshal.o(.text+0x1d05):/cygdrive/c/stuff/downloads/glib-2.2.3/gobject/glib-genmarshal.c:284: undefined reference to `_g_strdup_printf' 
: 
glib-genmarshal.o(.text+0x3edd): In function `print_blurb': 
/cygdrive/c/stuff/downloads/glib-2.2.3/gobject/glib-genmarshal.c:868: undefined reference to `_g_fprintf' 
collect2: ld returned 1 exit status 
make[2]: *** [glib-genmarshal.exe] Error 1 
make[2]: Leaving directory `/cygdrive/c/stuff/downloads/glib-2.2.3/gobject' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/cygdrive/c/stuff/downloads/glib-2.2.3' 
make: *** [all-recursive-am] Error 2 

Thanks for your help! 
Alan


Re: GTK TreeView Column Header Colors

2003-11-19 Thread Tim Evans
Carl B. Constantine wrote:

* Mike Dailey ([EMAIL PROTECTED]) wrote:

Is it possible to change the foreground and background
color of the column header in a GTK TreeView, using a
ListStore as the model?


Nope, I tried and tried. the Header lables, AFAICT, cannot be changed
from the standard colors. I'd be interested if anyone can prove me wrong
though.
It is possible, just not particularly obvious.  What you need to do is 
call gtk_tree_view_column_set_widget, passing in your own label that is 
set to display the column title.  Once the label is shown and realized, 
call gtk_widget_get_parent three times, which should move up through a 
GtkAlignment and a GtkHBox to give you a GtkButton.  This button is the 
column header.  Calling gtk_widget_modify_bg on it will change the 
background colour of the column header.

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


GtkEntry and validating user input

2003-11-19 Thread Roger Leigh
In many places, I get user input using a GtkEntry (well, Gtk::Entry,
since I'm using Gtkmm).  I'd like to validate the input and, if the
input is invalid, set the background colour of the Entry to red and
restore focus to the Entry, if needed.

I can do this by connecting to the changed signal of the
GtkEditable.  This works just fine when I want to filter the user
input (I just read the text in the Editable, strip out any unwanted
bits and set it with the new text).  However, I really only want to do
the validation (and highlighting in red) when the user has finished
typing, either when they focus out or press Enter.

When I tried this validation in the activate signal, this didn't
work: it activated the default widget, which was the OK button of the
dialog.  I couldn't prevent the dialog returning RESPONSE_OK, even
when there was an error.  How can I prevent this happening?  Should
returning false in the focus-out-event signal handler stop this?


Thanks,
Roger

-- 
Roger Leigh

Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: (GObject) What are properties?

2003-11-19 Thread Liu Neo-W4135C
Install property is a way for g_object_set_xxx series functions. An implementation of 
OO with C.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: 20031119 21:42
To: [EMAIL PROTECTED]
Subject: Re: (GObject) What are properties?


 Does your object some_gtk_widget have a property named foo that 
 takes a string value? If not, it is not surprising that the call 
 fails. It's a bit surprising that it crashes; I'd have expected a 
 warning.

Ah. No, of course it doesn't have that property, which explains why my experiment 
didn't work (and I re-checked; indeed I did get a warning, and the crash was a 
follow-up error caused by my program).

 Mathieu is doing a nice job on GObject documentaion. See 
 http://www.le-hacker.org/papers/gobject/index.html

I know; I read it (and also now understood that a property first must be installed 
before it can be used to assign values to it).

I guess I haven't quite wrapped my head around properties, but am I right in assuming 
that their main advantages (as opposed to, say, ordinary class members) are:

1) they are installable at runtime

2) they can emit signals when changed

Am I also right in assuming that each and every GObject carries around with it two 
hash tables; one for properties and one for the get/set_data() functions?

Thanks,
--Daniel

___
gtk-list mailing list
[EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Where can i find the fonts that GTK uses

2003-11-19 Thread Ma Frank-W4195C
Title: Message



Hi:
 I am 
not sure where the fontsthat Pango usesare located. Are they in X11 
or /usr/share. Is there any config file specifying the font 
directory.
 I 
currently have two types of GTK, one of which is based on Xwindows andthe 
other is built on DirectFB. So you'd better tell me the answers for both of 
them.
 Thank 
you!

Best 
Regards.