LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-01-2007, 03:45 PM   #1
ronald-be
Member
 
Registered: Aug 2004
Location: Belgium
Distribution: debian 5.02
Posts: 73

Rep: Reputation: 15
design of classes of widgets in GTK...


Hello all,

I'm trying to make a class for a standard window. For some reason there is a problem with g_signal_connect and the G_CALLBACK used within. How can I use a class-member to destroy a window for example... These are the code snippets :

class c_window

c_window(char *title, short border)
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window),title);
g_signal_connect (window, "destroy", G_CALLBACK(destroy), NULL);
vbox = gtk_vbox_new(FALSE,0);
gtk_container_set_border_width(GTK_CONTAINER(vbox),border);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(vbox);
gtk_widget_set_size_request(window,-1,-1);
gtk_widget_show(window);
};

void destroy(GtkWidget *window, gpointer data)
{
{
gtk_widget_destroy(window);
};

The compiler says "invalid use of member".

Any ideas?

Greetings,

Ronald
 
Old 06-02-2007, 01:56 AM   #2
nc3b
Member
 
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32
Maybe I am missing something, but I really don't see why you have


Code:
void destroy(GtkWidget *window, gpointer data)
{
{
gtk_widget_destroy(window);
};
 
Old 06-02-2007, 04:33 AM   #3
ronald-be
Member
 
Registered: Aug 2004
Location: Belgium
Distribution: debian 5.02
Posts: 73

Original Poster
Rep: Reputation: 15
open bracket typo...

hello,

yes, i saw afterwards... but there was a closing bracket too which didn't appear in the snippet. And removing that pair of brackets (the one u saw and the other bracket) doesn't make any difference for the real problem. What now?

ronald
 
  


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
extending gtk+-2.0 widgets with c++ markelo Programming 1 03-27-2007 12:39 PM
Widgets are not displaying while execution+GTK santhosh.linux Programming 1 03-17-2006 04:15 PM
GTK theme: not all widgets are changed kornerr Linux - General 1 01-16-2006 09:05 AM
GTK widgets don't show text phaidros Linux - Software 0 12-16-2003 06:45 AM
GTK problem: no text in widgets phaidros Linux - Newbie 0 12-16-2003 02:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:46 AM.

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