LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-02-2003, 01:23 PM   #1
Paul6253
LQ Newbie
 
Registered: Sep 2003
Posts: 7

Rep: Reputation: 0
gtk_clist_append problems


In short, This GTK function is not working for me.
I declared an external table of pointers to all the data
declared in main. This table is included in a file with callbacks.
The reason I use the Table is so I can pass more than two data
types to the handler.
The handler 'on_add_clicked' calls the append function--which should put my clist data in the list.


'on_add_clicked' is the handler that's connected to an
button that gets clicked when the user has filled in all the
entry boxex with their data,
the handler basically (should) grab the text from the entry boxes
and stick 'em in the clist object I created.

'user_data' is a pointer to a struct which encapsulates pointers to the objects created in main-- this is the
only way I how know to pass more than 2 objects to a gtk handler--other than evil global vars!
it can only accept 2 args: the object your hooking and some xtra
data.

Thanks for any help!


Code:
// the handler
gtk_signal_connect (GTK_OBJECT (button1), "clicked",
                      GTK_SIGNAL_FUNC (on_add_clicked),
                      &StuffyBoy);

on_add_clicked(GtkButton  *button,gpointer user_data)
{
    gint row;
    Stuff * data;
    gchar * ptex[3];
    gchar **text;

    data =  (Stuff *)user_data;

// hooking
//entry box-- niether work

    ptex[0]  = gtk_entry_get_text(GTK_ENTRY(data->sentry1)  );
    ptex[1]  = gtk_entry_get_text(GTK_ENTRY(data->sentry2)  );
    ptex[2]  = gtk_entry_get_text(GTK_ENTRY(data->sentry3)  );

    text = ptex;
    /*********The trouble call*******/
    row = gtk_clist_append( (GtkCList *)data->sclist1,
                       text );



}
// below is table for accessing data in main

typedef struct {

  GtkWidget *swindow1; // pointers to objects created in main
  GtkWidget *sbox1;
  GtkWidget *svbox1;
  GtkWidget *smenubar1;
  GtkWidget *svbox2;
  GtkWidget *slabel1;
  GtkWidget *sentry1;
  GtkWidget *svbox3;
  GtkWidget *slabel2;
  GtkWidget *sentry2;
  GtkWidget *svbox5;
  GtkWidget *slabel3;
  GtkWidget *sentry3;
  GtkWidget *svbox6;
  GtkWidget *shbox2;
  GtkWidget *sbutton1;
  GtkWidget *shbox3;
  GtkWidget *sbutton2;
  GtkWidget *sscrolledwindow1;
  GtkWidget *sclist1;
  GtkWidget *slabel4;
  GtkWidget *slabel5;
  GtkWidget *slabel6;
} Stuff ;


Stuff StuffyBoy;
 
  


Reply



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
Ethernet Adsl Modem Driver Problems And Install Problems... akhilnair Linux - Hardware 12 11-28-2004 08:19 AM
cisco 350 wireless problems and suse x-server problems incognito9 Linux - Wireless Networking 5 10-14-2004 07:53 AM
Problems with OSS while trying to avoid problems in ALSA (scratchy sound) GT_Onizuka Linux - General 1 02-05-2004 11:55 PM
Problems, problems, problems. Lets start with the soundcard Kre8ive Linux - Newbie 5 08-07-2003 01:20 AM
Problems, problems, problems. Lets start with the ES 1868 AudioDrive Kre8ive Linux - Newbie 1 08-06-2003 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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