How can I wrap or scroll text inside a GtkLabel to keep the width?

2008-12-11 Thread Guenther Meyer
hi,

I have GtkLabels packed inside some vboxes or tables, the width of the box is 
determined by the size of some other elements (buttons, listviews, ...).
when the text inside the labels is changed, and this text is too long to fit, 
the box automatically resizes, which distorts the whole window layout and 
pushes some widgets off the screen.
so how can I fix the width of the GtkLabel (which I don't know at creation), 
and let the text automatically wrap or scroll, if it doesn't fit?


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

how to set widget background?

2007-12-03 Thread Guenther Meyer
hi,

I have a hbox that looks like this:

-
|  ||
|      |    |
|      |    |
|  ||
-

 is a gtkimage
 is text in gtklabel

how can I set the background color for the whole hbox?
gtk_widget_modify_bg won't work.

I need the color for the whole hbox. when I set the background of the text, 
only the background of the letters is drawn in the specified color...

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

event for window maximize

2007-11-21 Thread Guenther Meyer
hi,

maybe here is someone, who could help me:

my application contains a widget with a drawable, that has to be redrawn in a 
differet size when the application window is resized.
when I resize the window this works perfectly; I did this by connecting a 
callback that does the necessary stuff to the configure-event signal.

but when I press the maximize button this won't work.
the gtk reference says to connect to the window_state_event signal.
when I do this, my callback function will be executed, but BEFORE the window 
has its new size, so I can't calculate the right values.
I tried to use g_connect_after instead of g-connect, but when I do this, 
nothing happens.

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

gtktree inside combobox

2007-09-13 Thread Guenther Meyer
hi,

I have a question regarding a combobox:

what I currently have, is a filled gtktreemodel, and a gtktreeview, that works 
great in its own window.
but it should be possible to render the data into a combobox.
I played around a little bit, but all I got, is a combobox, that builds kind 
of treelike structure of popups with no content.
how can I attach or apply my renderers to this?

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

Re: How to build a GtkTree?

2007-05-27 Thread Guenther Meyer
Am Samstag 26 Mai 2007 schrieb David Nečas:
 You know it.  In the example it's either the same parent
 iter as you used in the last insertion or it is the iter you
 *obtained* in the last insertion.  If you want to go up
 a level, use gtk_tree_model_iter_parent().

sure, I know the iter of the last insertion.
but what I really
  Wwhat I need  is the iter to a given entry; to say it in sql-style:
 
SELECT iter FROM tree WHERE content=someparententry;

 How would you express content=someparententry?

This is the data that's stored in one of the rows, and it can tell me where 
this entry belongs.
For example, if I have the data album4.song2, then I know that this entry 
has to be stored as a child of the entry album4.
But to insert this into the tree, I have to know the iter of the parent 
entry album4, which I don't know.
The only way I could imagine to get this, is to walk the whole tree and check 
for the wanted parent entry, and that every time when I want to insert 
soemthing. But there must be a more efficient way to do this...

 If you want to search the whole tree using some custom
 condition, use gtk_tree_model_foreach().  That's not exactly
 efficient to do repeatedly though.  If you can tell on each
 tree level what to look for (i.e. you don't have to search
 all leafs), you can easily walk through the tree and always
 descend one level when you find what you are looking for on
 that level -- AFAIK there's no function for that, it would
 be probably equally complicated to use as walking though the
 tree manually...

Ok, thanks. So I have it to do this way.
As this is done only one time at the start of the program, I hope it will not 
take to much time...





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

Re: HELP: GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

2007-05-26 Thread Guenther Meyer
Hi, finally it seems, that I solved the problem :-)

after removing a GSList, which I used for some radiobuttons, all the warnings 
were gone, and it seems to work now.

thanks for your tips!



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

How to build a GtkTree?

2007-05-26 Thread Guenther Meyer
hi,

I have another problem; I did read the documentation about it but I'm a little 
bit confused about these iter/path things.

What I like to do, is building a tree from some data, that is available in  
the following format:
catA
CatB
CatB.a
CatB.b
CatB.a.x
CatC
CatC.q
CatC.q.1
CatC.q.1.a
CatD
... and so on...

I already managed to build a flat tree, but I have no clue, how to build a 
real tree out of this.


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

Re: How to build a GtkTree?

2007-05-26 Thread Guenther Meyer
Am Samstag 26 Mai 2007 schrieben Sie:
 You need to insert rows with parents.
 Take a look at the definition of:
 gtk_tree_store_insert ()

 if parent is null, the row will be a root row... if parent is
 non-null the row will be a child of parent.

Yes, I know that. Maybe I have asked the wrong question...

The problem is, I don't know the iter of the parent entry, that I have to use.

Wwhat I need  is the iter to a given entry; to say it in sql-style:

  SELECT iter FROM tree WHERE content=someparententry;

after that I can use the result value as parent for the new 
gtk_tree_store_insert statement.

Is there a function for this, or did I miss something.

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

HELP: GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

2007-05-23 Thread Guenther Meyer
hi,

I'm working on a gtk-project for some month; I already solved a lot of 
problems by myself, but I'm still learning.
But now I have a problem, where I can't find any solution:

In my application there's is one window, when I'm closing it, I always can see 
the following messages:

GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion 
`G_TYPE_CHECK_INSTANCE (instance)' failed

and sometimes the application segfaults after this.

The interesting thing is, that there are other windows, that use exactly the 
same code, but they work without any problems...

any hints or tips?

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

Re: HELP: GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

2007-05-23 Thread Guenther Meyer
Am Mittwoch 23 Mai 2007 12:38 schrieb David Nečas:
 On Wed, May 23, 2007 at 12:16:51PM +0200, Guenther Meyer wrote:
  I'm working on a gtk-project for some month; I already solved a lot of
  problems by myself, but I'm still learning.
  But now I have a problem, where I can't find any solution:
 
  In my application there's is one window, when I'm closing it, I always
  can see the following messages:
 
  GLib-GObject-WARNING **: instance of invalid non-instantiatable type
  `(null)'
 
  GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion
  `G_TYPE_CHECK_INSTANCE (instance)' failed
 
  and sometimes the application segfaults after this.
 
  The interesting thing is, that there are other windows, that use exactly
  the same code, but they work without any problems...
 
  any hints or tips?

 Use valgrind.

yes, I already was told that. but it floods me with messages, so I can't make 
any use of it. is there agood howto or something like that anywhere?

 And use gdb, since you get segfaults, have you tried to at
 least print backtrace to see where it crashes?

   gdb program core.12345
   backtrace

yes, but that doesn't really help me...

Program received signal SIGSEGV, Segmentation fault.
0x0ef042fc in ?? () from /lib/libc.so.6
(gdb) backtrace
#0  0x0ef042fc in ?? () from /lib/libc.so.6
#1  0x0ef041fc in ?? () from /lib/libc.so.6
#2  0x0ef06874 in ?? () from /lib/libc.so.6
#3  0x0ef08ad4 in malloc () from /lib/libc.so.6
#4  0x0f84d2fc in cairo_create () from /usr/lib/libcairo.so.2
#5  0x0fb07f90 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#6  0x0fb08130 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#7  0x0fb09d14 in gdk_window_begin_paint_region () 
from /usr/lib/libgdk-x11-2.0.so.0
#8  0x0fd250f8 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#9  0x0fb0a1f0 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#10 0x0fb0a4e4 in gdk_window_process_all_updates () 
from /usr/lib/libgdk-x11-2.0.so.0
#11 0x0fb0a5b0 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#12 0x0f6cbe78 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x0f6ce674 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#14 0x0f6d2308 in ?? () from /usr/lib/libglib-2.0.so.0
#15 0x0f6d2774 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#16 0x0fd25464 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#17 0x10016750 in main (argc=1, argv=0x7fac3824) at gpsdrive.c:5825
















 You can also make GLib abort (and dump core) on CRITICAL or
 WARNING messages using g_log_set_always_fatal() or more
 flexibily by setting the G_DEBUG environment variable (see
 GLib reference documentation).

 The first two points apply generally, not just to Gtk+
 programs.

 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