LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 04-21-2005, 10:49 PM   #1
geminigal
Member
 
Registered: Apr 2005
Posts: 53

Rep: Reputation: 15
Calling another function from a function using GTK


Hello ppl! I had a problem in my coding in C, in which whenever i try to call another function from a function, there will be an error stating that the function called is undeclared. How do i solve this?

I m using the GTK programming using C. so i hav problem in calling another function from a function with the different widgets declared in each function. wonder if there is a way to call the other functions? or there is no other way to do so?

Tq.
 
Old 04-22-2005, 03:47 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,535

Rep: Reputation: 148Reputation: 148
Re: Calling another function from a function using GTK

Quote:
Originally posted by geminigal
Hello ppl! I had a problem in my coding in C, in which whenever i try to call another function from a function, there will be an error stating that the function called is undeclared. How do i solve this?
No headers included? Please post a short fragment of your code to make sure.

Quote:
I m using the GTK programming using C. so i hav problem in calling another function from a function with the different widgets declared in each function. wonder if there is a way to call the other functions? or there is no other way to do so?
You mean you are in a callback for one widget and want to do something with another? Glade generates a set of macros that build widget tree. Then you can search for a widget (and its child widgets) using their names and get pointer.
 
Old 07-11-2005, 02:05 AM   #3
atokatli
LQ Newbie
 
Registered: Jul 2005
Posts: 7

Rep: Reputation: 0
hi,
if we have a function like below

void deneme(GtkWidget *button, gpointer data)
{
xmlNode *root = NULL;
xmlNode *cur_node, *child_node;

xmlDocPtr doc;
xmlNodePtr cur,cur_2;
doc = xmlParseFile("radikal.xml");
FILE * dosya;
dosya = fopen ("zzgeldi.txt", "wt");
fprintf(dosya,"buradayoı");
fclose(dosya);

}

how can we call this funcion from another
function
likewise
void refresh_the_subscribtions(GtkWidget *button, gpointer data)
{
//here function must be called
}

I can not make this
please help me
 
Old 07-11-2005, 02:10 AM   #4
atokatli
LQ Newbie
 
Registered: Jul 2005
Posts: 7

Rep: Reputation: 0
It is as a function which makes a button press simulation
additionally, I want to add that
on menu there is a button, if I clicked two bttons seperately
they are work very well
but I want to press the other button automatically
 
Old 07-11-2005, 03:15 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,535

Rep: Reputation: 148Reputation: 148
It looks you need to connect the event of pressing one button with pressing the second one. That's easier than running the function directly.
 
  


Reply


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
not calling copy constructor on function return jhorvath Programming 7 09-22-2009 12:43 PM
Function pointers, calling, and templates The_Nerd Programming 2 10-09-2005 07:08 PM
switch statements calling a function tekmorph Programming 2 10-19-2004 05:53 PM
Calling my function through MACROS in OpenOfficeWriter mcp_achindra Linux - Software 0 07-05-2004 06:56 AM
java, call function in calling object exodist Programming 9 06-13-2004 11:49 PM


All times are GMT -5. The time now is 09:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration