How to Callback Function After Creating a GUI

  • Thread starter Thread starter cherish_girl
  • Start date Start date
  • Tags Tags
    Gui
AI Thread Summary
To call a function after creating a GUI, such as a button for summing two numbers, you need to link the button's action to the function. The button object, referred to as btnSum, should have its text property updated with the result of the function, like btnSum.text = doSum(fieldA, fieldB). It's essential to clarify the programming language being used, as the implementation can vary significantly between languages like C#, Java, or C++. The user expressed difficulty in understanding the basics of GUI programming and requested detailed guidance on how to implement this functionality. Resources and tutorials specific to the chosen programming language are recommended for further learning.
cherish_girl
Messages
4
Reaction score
0
after creating a gui ,how to call back a particular function?
for example ,if i have created a gui call for adding two numbers with one push botton named 'sum' ,so that when we click on the sum push botton ,it should display the result.the problem is how to link this push button to call the 'sum' function.


waiting for reply about how to callback the function in detail as early as possible please.
 
Technology news on Phys.org
Well, if you're simply looking to assign the result to the the button, then some version of this:


btnSum.text = doSum(fieldA, fieldB)

btnSum is the reference to your button object, and it will have a text or label or some such property.
 
It would help to know whether this is C#/.NET, Java, Qt, C++ or what.
 
DaveC426913 said:
Well, if you're simply looking to assign the result to the the button, then some version of this:


btnSum.text = doSum(fieldA, fieldB)

btnSum is the reference to your button object, and it will have a text or label or some such property.

how should i give,like btnsum.text=dosum(2,3).will i get the answer if i give like this,if yes where will i get the answer?and where should i write this,i.e..,in which line in Mfile?i.e..,should i write it inpushbutton call back?please give me the exact procedure of how to run a GUI for addition of two numbersie..,how to write a program in Mfile.pleasezzz.will be waiting for ur reply.
 
How are you learning this? It sounds like you've got a fair bit of reading ahead of you.

How are you on the basic basics?

Do you know how to simply press a button and have it print "Hello World!" on the screen?
 
DaveC426913 said:
How are you learning this? It sounds like you've got a fair bit of reading ahead of you.

How are you on the basic basics?

Do you know how to simply press a button and have it print "Hello World!" on the screen?

sorry am neew to this topic,i don't know how to print "hello world".on the screen just by pressing a button.i need to learn form basics,this is entirely new for me.
 
cherish_girl said:
sorry am neew to this topic,i don't know how to print "hello world".on the screen just by pressing a button.i need to learn form basics,this is entirely new for me.
But how are you learning now? Book? Class?
 
DaveC426913 said:
But how are you learning now? Book? Class?

from net,as am new to this am unable to understand.so will u pleasezzz explain me in detail or else give me any web sites regarding gui.ill refer.i went thru a website named www.matlabgui.com.it[/URL] is clearly given about how to add two numbers ,but wen i implement the same am getting the result as some garbage value.will u please check that web site.
 
Last edited by a moderator:
Coin said:
It would help to know whether this is C#/.NET, Java, Qt, C++ or what.

I agree, giving advices without knowing language/GUI is little bit strange. Especially if you cannot show anything or react on buttons yet.
 
Back
Top