Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-06-2005, 07:17 PM   #1
Registered: Feb 2004
Posts: 31

Rep: Reputation: 15
GTK: how to write into a clist?

Hi there,

with glade-2 I've created an application which should show translated data into a clist. Therefore I use several buttons to control the clist. One of them is the start/stop button and a clear button. When the start/stop is pushed I want to write some text ("Hello World") into the clist. Currently I want to do this directly by the start-stop-function. In the future, the start-stop function reveices and translate the data to text.

I think that there's a problem using the g_signal_connect functions. I'm not sure.

The code produced by glade:

GtkWidget* create_main_window (void)
  GtkWidget *clist1;
  GtkWidget *startstop;
  GtkWidget *clr;

  startstop = gtk_label_new_with_mnemonic (_("Start\nStop"));
  gtk_widget_show (startstop);
  gtk_box_pack_start (GTK_BOX (hbox21), startstop, FALSE, FALSE, 3);

  gtk_widget_show (clr);
  gtk_table_attach (....);
  gtk_container_set_border_width (....);

  clist1 = gtk_clist_new (9);
  gtk_widget_show (clist1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), clist1);

  ...several clist options here...

  g_signal_connect ((gpointer) startstop, "clicked",
                    G_CALLBACK (on_start_stop_clicked),

  g_signal_connect_swapped ((gpointer) clr, "clicked",
                            G_CALLBACK (on_clr_clicked),
                            GTK_OBJECT (clr_clicked_object));

  GLADE_HOOKUP_OBJECT (main_window, clist1, "clist1"); // ?????
void on_start_stop_clicked (GtkButton *button, gpointer user_data)
  gtk_clist_set_text((GtkCList*)user_data, 1, 1, "Hello World");

void on_clr_clicked(GtkButton *button, gpointer user_data)
The messages I receive when the program is running in a terminal window are:
(prog:22717): Gtk-CRITICAL **: file gtkclist.c: line 2243 (gtk_clist_set_text): assertion `GTK_IS_CLIST (clist)' failed

(prog:22717): Gtk-CRITICAL **: file gtkclist.c: line 2701 (gtk_clist_clear): assertion `GTK_IS_CLIST (clist)' failed
How can I solve this???????


Last edited by Li...; 05-06-2005 at 07:19 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
grip : no write access to write encoded file bidouilleur Linux - Software 5 10-09-2010 09:23 PM
Freerock uninstall stole GTK looking for up-to-date pango, atk, gtk, glib and xft tgz Oholiab Slackware 8 09-18-2005 11:57 AM
cant find gtk-config file or gtk-devel to install happychappy Linux - Software 2 02-16-2005 12:46 AM
GTK+ CList Internationalization wpyh Programming 0 12-11-2004 11:26 PM
clist pantera Programming 0 07-06-2004 02:41 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration