Buttons in groups

2007-06-07 Thread Christopher Garrett
Hi,

Is there a way of placing a GtkToggleButton into a group so that when one button
is selected the others in the group automatically get unselected?

Best regards,

Chris.

Chris Garrett
UNIX Administrator
MISD Operations Group, University of Cambridge 
01223-(7)66687

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


Re: Buttons in groups

2007-06-07 Thread Yeti
On Thu, Jun 07, 2007 at 07:25:13AM +0100, Christopher Garrett wrote:
 Is there a way of placing a GtkToggleButton into a group so that when one 
 button
 is selected the others in the group automatically get unselected?

By using GtkRadioButtons?

Yeti

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


Re: gdk_widget_modify_bg deadlock

2007-06-07 Thread Tor Lillqvist
JAMES SCOTT writes:
  The kicker is that this works fine in linux (no deadlock) -- it only
  deadlocks on a cross compiled windows exe. 

Sure. You should believe people when they say that you can't use GDK
from multiple threads on Windows. It's not just a random statement out
of thin air.

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


RE: Buttons in groups

2007-06-07 Thread Christopher Garrett
Hi,

Thanks for the quick reply.  I should have said that its for groups of tools,
and I'd like to have icons on the buttons - I'm not sure that  GtkRadioButtons
can use icons, but if they can they'd be perfect for me.

I see that Fig. 3.9 in the HIG suggests visually how to implement a toolbox with
multiple groups of buttons, which is the sort of thing I had in mind. 

Best regards,

Chris.

Chris Garrett
UNIX Administrator
MISD Operations Group, University of Cambridge 
01223-(7)66687

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Necas (Yeti)
Sent: 07 June 2007 07:28
To: gtk-app-devel-list@gnome.org
Subject: Re: Buttons in groups

On Thu, Jun 07, 2007 at 07:25:13AM +0100, Christopher Garrett wrote:
 Is there a way of placing a GtkToggleButton into a group so that when 
 one button is selected the others in the group automatically get unselected?

By using GtkRadioButtons?

Yeti

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


Re: Buttons in groups

2007-06-07 Thread Yeti

Please don't top-post.

On Thu, Jun 07, 2007 at 07:41:42AM +0100, Christopher Garrett wrote:
 I should have said that its for groups of tools,
 and I'd like to have icons on the buttons - I'm not sure that  GtkRadioButtons
 can use icons, but if they can they'd be perfect for me.

GtkRadioButton is a GtkContainer (as any button) and can
contain anything, just don't use the convenience
cosntructors and pack the icon or whatever yourself.  And
see also gtk_toggle_button_set_mode().

You should also consider GtkToolbar if you want to create
a toolbar...

Yeti

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


RE: Buttons in groups

2007-06-07 Thread Christopher Garrett

 GtkRadioButton is a GtkContainer (as any button) and can contain anything,
just don't use the convenience cosntructors and pack the icon or whatever
yourself.  And see also gtk_toggle_button_set_mode().
 You should also consider GtkToolbar if you want to create a toolbar...

Thanks - I'll give it a go.

/Chris.

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


Collapse and expand in GtkTreeView

2007-06-07 Thread Christoph Schmeding
Hello!

When I expand an item in a GtkTreeView that I just collapsed before, 
only the first child level of the expanded item is shown.

Example:
Before collapsing:
- Item 1
   - Item 11
  - Item 111
  - Item 112
   - Item 12

After collapsing Item 1 and re-expanding it:
- Item 1
   - Item 11
   - Item 12

Is there a possiblity (a property or whatever) to get the same state as 
before collapsing, or do I have to handle it myself?

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


Re: [SPAM] cross compiling and ld auto-import errors

2007-06-07 Thread Gabriele Greco
Bethany Seeger wrote:
 From what I've read, I need to force (external) constants to be
 variables, but I'm not sure how I can do that when the errors are coming
 from the glib library, underneath Gtk/Gdk.  (or declare them explicitly
 with __declspec(dllimport)).  

 I'm relatively new to cross-compiling, so I'm a little baffled as to
 where to go with this. 
   
If this can be of any use when I crosscompile I don't link directly with 
the DLLs but with the import files provided in the gtk-*-dev archives:

In my makefile I have this (I've a win32 target that uses CROSSDIR, 
CROSSCXX, CROSSLIBS instead of the standard ones):

CROSSLIBS = -L$(CROSSDIR)/lib/gtk-2.0 -mwindows -mno-cygwin \
 -mms-bitfields -lgtk-win32-2.0.dll -lgdk-win32-2.0.dll -\
 -latk-1.0.dll -lgdk_pixbuf-2.0.dll -lpango-1.0.dll 
-lpangowin32-1.0.dll \
 -lgmodule-2.0.dll -lgobject-2.0.dll -lglib-2.0.dll 
-lgthread-2.0.dll \
 -lstdc++ -luser32 -lws2_32 -lexpat -ljpeg

ls /usr/i586-mingw32msvc/lib/gtk-2.0/
lib libgdk_pixbuf-2.0.dll.a  libgmodule-2.0.dll.a  
libgtk-win32-2.0.dll.a   libpangoft2-1.0.dll.a
libatk-1.0.dll.alibglib-2.0.dll.alibgobject-2.0.dll.a  
libpango-1.0.dll.a   libpangowin32-1.0.dll.a
libgdk-win32-2.0.dll.a  libglib.dll.alibgthread-2.0.dll.a  
libpangocairo-1.0.dll.a


--
Bye,
 Gabry

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


Re: cross compiling and ld auto-import errors

2007-06-07 Thread Tor Lillqvist
Gabriele Greco writes:
  CROSSLIBS = -L$(CROSSDIR)/lib/gtk-2.0 -mwindows -mno-cygwin \

The -mno-cygwin switch does nothing when compiling with a pure Win32
(mingw) compiler, as no Cygwin is involved at all.

  -lgtk-win32-2.0.dll -lgdk-win32-2.0.dll

I would leave out the .dll here to avoid risking confusion. (Somebody
might think you are referring to the dll files themselves here.) The
Win32-targeted linker looks for also libfoo.dll.a, not just libfoo.a
when it encounters -lfoo. At least natively, presumably also when
cross-compiling.

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


Re: gdk_widget_modify_bg deadlock

2007-06-07 Thread Bethany Seeger

I wrote that, not James Scott. 

Often times you need to hear it first, before you have a chance of
believing it.   I hadn't heard that yet. 

Time to add the use of gtk_idle_add or some such thing to get rid of the
multiple thread problem. 

Bethany



On Thu, 2007-06-07 at 09:32 +0300, Tor Lillqvist wrote:
 JAMES SCOTT writes:
   The kicker is that this works fine in linux (no deadlock) -- it only
   deadlocks on a cross compiled windows exe. 
 
 Sure. You should believe people when they say that you can't use GDK
 from multiple threads on Windows. It's not just a random statement out
 of thin air.
 
 --tml
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: [SPAM] Re: cross compiling and ld auto-import errors

2007-06-07 Thread Gabriele Greco
Tor Lillqvist wrote:
 I would leave out the .dll here to avoid risking confusion. (Somebody
 might think you are referring to the dll files themselves here.) The
 Win32-targeted linker looks for also libfoo.dll.a, not just libfoo.a
 when it encounters -lfoo. At least natively, presumably also when
 cross-compiling.
   
Yes, just tried it and it works also without the DLL :) (at least with 
the mingw version packaged in the debian 4+).

---
Bye,
 Gabry


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


Setting G_SLICE=always_malloc at runtime

2007-06-07 Thread Raja Mukherji
Hi All,
I'm writing a binding for Gtk to my programming language Wrapl, and
want to make sure that all memory is allocated by the Hans-Boehm
garbage collector. The glib/gobject shared libraries are loaded
dynamically and I call g_mem_set_vtable to change to GC_malloc,
GC_realloc, GC_free, etc. However g_slice doesn't use these. I know
that setting the environment variable G_SLICE to always_malloc will
solve this, but I want to do this at runtime, just after the relevant
shared libraries are loaded, but before they are used (basically at
the same time as when I'd call g_mem_set_vtable).
Is this possible?
Thanks,
Raja
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Setting G_SLICE=always_malloc at runtime

2007-06-07 Thread Yeti
On Thu, Jun 07, 2007 at 08:04:08PM +0100, Raja Mukherji wrote:
 I'm writing a binding for Gtk to my programming language Wrapl, and
 want to make sure that all memory is allocated by the Hans-Boehm
 garbage collector. The glib/gobject shared libraries are loaded
 dynamically and I call g_mem_set_vtable to change to GC_malloc,
 GC_realloc, GC_free, etc. However g_slice doesn't use these. I know
 that setting the environment variable G_SLICE to always_malloc will
 solve this, but I want to do this at runtime, just after the relevant
 shared libraries are loaded, but before they are used (basically at
 the same time as when I'd call g_mem_set_vtable).
 Is this possible?

GSlice is initialized, i.e. it looks at G_SLICE, on the
first use or when thread support is initialized.  So just
set the variable before that.

Yeti

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


Re: Win32 custom (pixbuf) cursors reverting to standard pointer, on left/right click

2007-06-07 Thread Jason Compton
We have gone ahead and filed this behavior as a GTK/Win32 bug, complete 
with example code and example workaround.

http://bugzilla.gnome.org/show_bug.cgi?id=445284

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


multi thread app and often variable accessing

2007-06-07 Thread Tomasz Jankowski
Hi!

I'm working on small multi thread application based on Gobject. In one of my
objects I have integer variable, which determine current object's status.
The problem is, that I need to read it's status really often, so it will be
to expensive to lock and unlock mutex all the time. Can I use there atomic
operations provided by GLib instead of mutex locking and unlocking system? I
mean, if g_atomic_get and g_atomic_set would not occur any problems, when I
will try to access the same variable from two thread at the same time?

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


Re: Setting G_SLICE=always_malloc at runtime

2007-06-07 Thread Raja Mukherji
Do I set the environment variable? Because code like

setenv(G_SLICE, always_malloc, 1);
g_thread_init(0);

doesn;t seem to work.
I noticed the g_slice_set_config functions in gslice.h and tried

g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, 1);

but this gives me the error

(process:6533): GLib-CRITICAL **: g_slice_set_config: assertion
`sys_page_size == 0' failed

and also does not work.
What am I doing wrong?

Raja


On 6/7/07, David Nečas (Yeti) [EMAIL PROTECTED] wrote:
 On Thu, Jun 07, 2007 at 08:04:08PM +0100, Raja Mukherji wrote:
  I'm writing a binding for Gtk to my programming language Wrapl, and
  want to make sure that all memory is allocated by the Hans-Boehm
  garbage collector. The glib/gobject shared libraries are loaded
  dynamically and I call g_mem_set_vtable to change to GC_malloc,
  GC_realloc, GC_free, etc. However g_slice doesn't use these. I know
  that setting the environment variable G_SLICE to always_malloc will
  solve this, but I want to do this at runtime, just after the relevant
  shared libraries are loaded, but before they are used (basically at
  the same time as when I'd call g_mem_set_vtable).
  Is this possible?

 GSlice is initialized, i.e. it looks at G_SLICE, on the
 first use or when thread support is initialized.  So just
 set the variable before that.

 Yeti

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

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