How to Callback Function After Creating a GUI

  • Thread starter Thread starter cherish_girl
  • Start date Start date
  • Tags Tags
    Gui
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 4K views
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.
 
Physics 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.