Button problem

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Button problem

    Hello,

    For a project I have, I want to add product at the end of a specification process and I need access to process after they're created. An idea of mine is to add button linked to product every time I create a new one.
    My problem is that I just can't get rid of it. I've tried to create button via every avaible method (BUTTON_Create, BUTTON_CreateEx, BUTTON_CreateIndirect...) but every time, either I supposedly have a button with a "callback" function but I'm not able to display it or I display correctly the button but his "callback" is the default one that I can't exploit.
    So I need just a little help because I'm a bit lost in all those code lines. ;(

    Thanks by advance,

    Nairolf
  • Hi,

    Unfortunately, I'm not entirely sure what you mean by 'to add product at the end of a specification process'.

    Do mean a window which represents a specific 'product' and you want to switch between the different windows on a click on the buttons?

    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Schoenen,

    I've said product but it more like a production program. A menu allows to create new production program and I want to create in live the button used to select the correct program when the system is in production.
    And a program is just a serie of values that the main program have to know before starting the production.

    regards
    nairolf
  • Hi,

    So you want to create some buttons in a menu and want to react on button press?

    Attached is simple application which has 'menu' (which is nothing more than a window with some buttons). When pressing a button a TEXT widget displays which button has been pressed.

    Regards
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    Not exactly. I want a menu with button linked to a program.
    And I want to dynamicaly add button to this menu if a new program is
    created (on react of the validate button of program creator menu).
    I already know how to react on button touch but, as I was saying, I'm not able to create a button with the behavior I want.

    regards,

    nairolf
  • Hi,

    So, you got a menu(1) with a button for each program. If you add a program from another(?) menu the first menu(1) should get an additional button?

    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    maybe like this (see attachment).

    Regards
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    I have modified my last example (attached). The buttons are created as child windows of the window with the callback _cbMenu(). Simply add a case WM_NOTIFY_PARENT to _cbMenu() and check which child sends the message. On button press the text in the background window gets changed.

    Regards
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.