Re: gtk 1.2.4 breaks my applications :(

hi owen,
> Rasca Gmelch <> writes:
> > in my app i create first a toplevel and a box widget. then i
> > call gtk_widget_show() cause i need a window to create pixmaps.
> > then i add other widgets. the problem with 1.2.4 is that
> > the toplevel will not be resized after the _show() call also
> > if i add other diffent widgets to the box widget :-((
> > 
> > is that a bug or a feature of gtk+? according to the changelog
> > there changed some thing with the geometry management.. i
> > think it's not a good idea to change the gtk+ lib in a way that
> > it breaks current programs.
> If your program worked with 1.2.3 and doesn't work with
> 1.2.4, then its a bug. (We are still actually struggling
> a bit with gtkwindow.c and will put out a 1.2.5 shortly).

i've found that 1.2.4 also breaks "gvim" a gtk+ version
of vim. starting with a existing file gives me a small
window instead of the usual size.

i also found an other strange problem which does *not*
exists if i only install 1.2.4 (btw. the programs are
using the shared libs). *but* if i recompile my programs
with the new gtk+ installation it is there:
drag and drop from my filemanager to my application panel
does not work.. !?

> Code that demonstrates the problem here would be much 
> appreciated. 

here is a small example which should work with 1.2.3
but not 1.2.4: with 1.2.3 it gives me 3 buttons as
i would expect. in 1.2.4 the three buttons are *very*
narrow (no resizing for button 2 and 3 after the toplevel
is shown). the original program is was talking about
could be found at

#include <stdio.h>
#include <gtk/gtk.h>

main (int argc, char **argv)
    GtkWidget *top, *box, *btn;

    gtk_init(&argc, &argv);

    top = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    box = gtk_hbox_new(TRUE, 2);
    gtk_container_add (GTK_CONTAINER(top), box);

    btn = gtk_button_new_with_label("1");
    gtk_box_pack_start (GTK_BOX(box), btn, TRUE, TRUE, 0);
    gtk_widget_show_all (top);

    btn = gtk_button_new_with_label("2");
    gtk_box_pack_start (GTK_BOX(box), btn, TRUE, TRUE, 0);

    btn = gtk_button_new_with_label("3");
    gtk_box_pack_start (GTK_BOX(box), btn, TRUE, TRUE, 0);

    gtk_widget_show_all (top);

    gtk_main ();
    return 0;

> [ That being said, there are much better ways of making
>   pixmaps than prematurely showing your toplevel windows.

i'm was sure there is a better way to do it. but until
no i wasn't be able to find a good example. in testgtk.c
and in the html-docu they allways use a window to create
a pixmap and don't use the *_colormap_*() functions.
please could you fill in some example lines:

 char *pixfile = "foo.xpm";
 GtkWidget *top, *box, *btn, *pixw;
 GdkPixmap *pixmap, *pixmap_mask;
 GdkColor background;

 top = gtk_window_new (GKT_WINDOW_TOPLEVEL);
 box = gtk_hbox_new (FALSE, 4);
 gtk_conainer_add (GTK_CONTAINER(top), box);

... ??

 btn = gtk_button_new ();
 gtk_container_add (GTK_CONTAINER(btn), pixw);
 gtk_box_pack_start (GTK_BOX(box), btn, TRUE, TRUE, 2);

 /#- Internet eMail:, FidoNet: 2:2410/304.5@fido -#\
<-#- Internet WWWeb: -------------#->
 \#- please do NOT quote these lines or other useless stuff! --#/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]