Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Call backs in GUI

  1. Jan 11, 2008 #1
    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.
  2. jcsd
  3. Jan 11, 2008 #2


    User Avatar
    Gold Member

    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.
  4. Jan 12, 2008 #3
    It would help to know whether this is C#/.NET, Java, Qt, C++ or what.
  5. Jan 15, 2008 #4
    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?plz give me the exact procedure of how to run a GUI for addition of two numbersie..,how to write a program in Mfile.plzzzz.will be waiting for ur reply.
  6. Jan 15, 2008 #5


    User Avatar
    Gold Member

    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?
  7. Jan 15, 2008 #6
    sorry am neew to this topic,i dont 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.
  8. Jan 15, 2008 #7


    User Avatar
    Gold Member

    But how are you learning now? Book? Class?
  9. Jan 15, 2008 #8
    from net,as am new to this am unable to understand.so will u plzzzz explain me in detail or else give me any web sites regarding gui.ill refer.i went thru a web site 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 plz check that web site.
    Last edited by a moderator: Apr 23, 2017
  10. Feb 1, 2008 #9
    I agree, giving advices without knowing language/GUI is little bit strange. Especially if you cannot show anything or react on buttons yet.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Call backs in GUI
  1. Vb.net\ Gui (Replies: 5)

  2. Java GUI (Replies: 3)