Menu

#56 How to update a tab ?

v1.0_(example)
closed
nobody
1
2022-12-14
2022-11-12
No

Hi Wilfried,

I have modified a bit checkbox.prg to demonstrate the problem I encounter.
I have a tab named Stats, in which when launching, I display a counter (initialized at 0).
I count the sum of checkboxes of 'Tab 1' and 'Tab 2' which checked.
When I check a checkbox, I display the counter in the status, but I need also to display it in the tab 'Stats'.

Is-it possible to do it ? and how ?

Thanks
A+

1 Attachments

Discussion

  • Wilfried Brunken

    Hello Alain,
    test program committed with r3148.
    See inline comments of the test program.

    I hope, that is your problem, tested with Ubuntu 22.04 LTS and Windows 11.

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE,Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-11-22

    So, we must add the size oy the tab title, and a little more.
    The problem, is that the initial value 0 covers the new one...

    function update_count()
    
    MEMVAR oDlg, cNbChecked, nbChecked
    cNbChecked=ltrim(str(nbChecked))
    
    @ 173,72 say cNbChecked of oDlg SIZE 60,22 STYLE WS_DLGFRAME
    //@ 173,58 say cNbChecked of oDlg SIZE 60,22 STYLE WS_DLGFRAME
    
    RETURN .T.
    

    And I don't know how to solve this problem ...

     
  • Wilfried Brunken

    Hello Alain,
    see commit r3150, report in the
    comment lines of test program.

    I hope, this is now the desired behavior.

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Wilfried Brunken

    Hello Alain,
    can i close this ticket ?

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-12-13

    Hi Wilfried,

    Sorry for the long time of silence, but I was very very busy (and that's always the case)

    Yes, it works fine, I just notice that I ought use an object instead of a variable, and refer to the tab instead of to the window

    I'm just aware to know a list of warnings where is located W0035, as it looks like w0004

    I will test the conditions which makes the test to crash

    Yes you can close

    Thanks
    A+

     

    Last edit: Aupeix Alain 2022-12-13
  • Wilfried Brunken

    • status: open --> closed
     
  • Wilfried Brunken

    Ticket closed.
    TNX Alain.

     

Log in to post a comment.