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

Re: Problem with clist



With a quick glance, it looks to me like you are dereferencing a pointer to a pointer. Try the following:
gtk_clist_append ((GtkCList *)clist, data[i]); 
Instead of:
gtk_clist_append ((GtkCList *)clist, &data[i]); 

Jimmy

-------------- Original message -------------- 

> I've got a clist which shows a dialog when you select an item, the 
> problem is that when you click on an entry in the list the dialog 
> freezes - it's ok if you use the arrow keys. 
> 
> Seems to be a combination of GTK_SELECTION_BROWSE and the fact that the 
> dialog is modal. 
> 
> I've attached a sample program which shows the problem. Not sure if I'm 
> doing something wrong or if it's a gtk bug. 
> 
> Jon 
> 
> ---------------------------------------------------------------------- 
> 
> #include 
> 
> void selection(GtkWidget *clist, gint row, gint column, GdkEventButton 
> *event, gpointer data) 
> { 
> GtkWidget *pwDialog, *pwBut; 
> 
> pwDialog = gtk_dialog_new(); 
> pwBut = gtk_button_new_with_label( ("Try to click me") ); 
> gtk_container_add( GTK_CONTAINER( GTK_DIALOG( pwDialog )->vbox ), pwBut 
> ); 
> gtk_signal_connect_object( GTK_OBJECT( pwBut ), "clicked", 
> GTK_SIGNAL_FUNC( gtk_widget_destroy ), GTK_OBJECT( pwDialog ) ); 
> 
> gtk_window_set_modal( GTK_WINDOW( pwDialog ), TRUE ); 
> g_signal_connect(G_OBJECT(pwDialog), "destroy", 
> G_CALLBACK(gtk_main_quit), NULL); 
> gtk_widget_show_all( pwDialog ); 
> gtk_main(); 
> } 
> 
> int main(int argc, char *argv[]) 
> { 
> int i; 
> char *data[4] = {"Milk", "Water", "Carrots", "Snakes"}; 
> GtkWidget *window, *clist; 
> 
> gtk_init(&argc, &argv); 
> window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 
> g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK 
> (gtk_main_quit), NULL); 
> 
> clist = gtk_clist_new_with_titles (1, NULL); 
> for (i = 0; i < 4; i++) 
> gtk_clist_append ((GtkCList *)clist, &data[i]); 
> 
> gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_BROWSE); 
> g_signal_connect(G_OBJECT (clist), "select_row", G_CALLBACK 
> (selection), NULL); 
> gtk_container_add(GTK_CONTAINER(window), clist); 
> 
> gtk_widget_show_all(window); 
> gtk_main(); 
> 
> return 0; 
> } 
> 
> _______________________________________________ 
> gtk-app-devel-list mailing list 
> gtk-app-devel-list gnome org 
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list From ed_welch inbox net  Tue Jul  6 18:36:28 2004
Return-Path: <ed_welch inbox net>
X-Original-To: gtk-app-devel-list gnome org
Delivered-To: gtk-app-devel-list gnome org
Received: from inbox.net (aaron.visual.com [209.123.16.34])
	by menubar.gnome.org (Postfix) with SMTP id C2D3A3B09DE
	for <gtk-app-devel-list gnome org>;
	Tue,  6 Jul 2004 18:36:28 -0400 (EDT)
Received: (qmail 27315 invoked by uid 99); 6 Jul 2004 23:27:57 -0000
Date: 6 Jul 2004 23:27:57 -0000
Message-ID: <20040706232757 27314 qmail inbox net>
From: "Ed Welch" <ed_welch inbox net>
To: gtk-app-devel-list gnome org
X-IP: 80.103.109.58
X-Mailer: Inbox Mailer (http://www.inbox.net)
Subject: How to compile gtk1.2 with KDevelop
X-BeenThere: gtk-app-devel-list gnome org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: ed_welch inbox net
List-Id: Writing Apps with GTK+ <gtk-app-devel-list.gnome.org>
List-Unsubscribe: <http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list>, 
	<mailto:gtk-app-devel-list-request gnome org?subject=unsubscribe>
List-Archive: </archives>
List-Post: <mailto:gtk-app-devel-list gnome org>
List-Help: <mailto:gtk-app-devel-list-request gnome org?subject=help>
List-Subscribe: <http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list>,
	<mailto:gtk-app-devel-list-request gnome org?subject=subscribe>
X-List-Received-Date: Tue, 06 Jul 2004 22:36:28 -0000

Hi,
Sorry if this seems like a stupid question, but  I can't find any information on how to compile a GTK app with KDevelop anywhere.
I can do it okay by putting  `gtk-config --cflags` in project/projects options/configure options/CPPFlags
However now I want to distribute my app and when you try to build the source from the command line (using ./configure, make) it complains that it can't find gtk/gtk.h.



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