button highlight problem



I'm using GTK 0.99.9 and have discovered a problem if you set a border
on a button with gtk_container_border_with. The highlight for when the
mouse is over the button is not drawn correctly.

I also notice a problem when more than one gtk_entry is on the screen. I
have a window with many gtk_entries side by side, when i drag the mouse
to select text in one entry and continue to drag into another entry, the
text in the first entry is not selected properly. I know these are
'cosmetic' problems, but they annoy me.

I've included a sample program to display the problems more accurately.
It is listed below and included as an attachment.

/* start of gtkbugs.c */
/*###################################################################*/
/*##                    gtkbugs display program                    ##*/
/*###################################################################*/

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

GtkWidget *window;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *entry1;
GtkWidget *entry2;
GtkWidget *entry3;
GtkWidget *label;
GtkWidget *button;

void destroy_window(GtkWidget *widget, gpointer *data)
 {
 gtk_main_quit();
 }

int main (int argc, char *argv[])
 {
 gtk_init (&argc, &argv);


 /* window */
 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 gtk_signal_connect (GTK_OBJECT (window), "delete_event",(GtkSignalFunc)
destroy_window, NULL);
 gtk_window_set_title (GTK_WINDOW (window), "GTK bugs program");

 vbox = gtk_vbox_new(FALSE,0);
 gtk_container_add(GTK_CONTAINER(window),vbox);
 gtk_widget_show(vbox);

 label = gtk_label_new("highlight is wrong:");
 gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
 gtk_widget_show(label);

 /* button bug */
 button = gtk_button_new_with_label("move over me");
 gtk_container_border_width (GTK_CONTAINER (button), 10);
 gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,0);
 gtk_widget_show(button);

 /* entry confusion */
 hbox = gtk_hbox_new(FALSE,0);
 gtk_container_add(GTK_CONTAINER(vbox),hbox);
 gtk_widget_show(hbox);

 entry1 = gtk_entry_new();
 gtk_entry_set_text(GTK_ENTRY(entry1),"foo bar in entry 1");
 gtk_box_pack_start(GTK_BOX(hbox),entry1,FALSE,FALSE,30);
 gtk_widget_show(entry1);

 entry2 = gtk_entry_new();
 gtk_entry_set_text(GTK_ENTRY(entry2),"entry 2 is hello world");
 gtk_box_pack_start(GTK_BOX(hbox),entry2,FALSE,FALSE,30);
 gtk_widget_show(entry2);

 entry3 = gtk_entry_new();
 gtk_entry_set_text(GTK_ENTRY(entry3),"extra test entry at entry 3");
 gtk_box_pack_start(GTK_BOX(vbox),entry3,FALSE,FALSE,0);
 gtk_widget_show(entry3);

 label = gtk_label_new("start dragging at \"bar\"\nand continue over to
the end of \"hello\"\nor to \"test\"");
 gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
 gtk_widget_show(label);

 gtk_widget_show(window);

 gtk_main ();
 return 0;
 }
/* end of file */

side question: just how many gtk front ends are there for mpg123?
    my version is at:
    http://www.geocities.com/SiliconValley/Haven/5235/mpg_main.html

-- 
John Ellis <gqview@geocities.com>
http://www.geocities.com/SiliconValley/Haven/5235/

gtkbugs.tar.gz



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