Menu

#90 hwg_WChoice display problem

v1.0_(example)
closed
nobody
hwg_WChoice (1)
1
2025-08-25
2025-08-12
No

Hi,
I have a little problem using it :

rg=hwg_WChoice( aMenu, "Menu du "+date, oMainWindow:nLeft+120,oMainWindow:nTop+140,,,,,,"Ouvrir", "Annuler" )

I have, here, 3 strings in the array, and only 2 appeared, the third appears empty, and just appears if I scroll .
It I change manually the size of the dialog, It's ok.
Is there a way to have directly a correct display ?

Thanks
A+

2 Attachments

Discussion

  • Aupeix Alain

    Aupeix Alain - 2025-08-16

    Hi,
    As there were only two result with hwg_choice (ok or cancel), I choose to create a dialog and use @ x,y browse.
    So no need to search why the display isn't correct.

    You can close
    Thanks
    A+

     
  • Wilfried Brunken

    Hello Alain,
    TNX for request to close this ticket.
    But i think, the function hwg_WChoice() must be run correct.
    I started the bugfix for LINUX some time ago,
    but on WinAPI the function works correct.

    I will close this ticket, if bug is fixed.

    With regards

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Wilfried Brunken

    Hello Alain,
    added a workaround for this bug in GTK with commit r3790.

    I will wait a few days for your response, then (i think),
    the ticket is ready to close.

    With regards

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2025-08-19

    Same problem ...
    If I change the size it's ok

    See hardcopies

    A+

     
  • Aupeix Alain

    Aupeix Alain - 2025-08-24

    Hi Wilfried,
    I don't understand your workaround. It doesn't change anything.

    I had a look to gtkmain.prg, and I saw you have added a parameter (nwline), but I don't understand how it works.

    FUNCTION hwg_WChoice( arr, cTitle, nLeft, nTop, oFont, clrT, clrB, clrTSel, clrBSel, cOk, cCancel,nwline )
    ...
       IF nwline == NIL ; nwline := 21 ; ENDIF  && Ticket 90
     ...
    
     * New formula, because of bug in GTK (Ticket 90)
       height := ( nwline + 5 ) * aLen + 4 + addY
    

    As nwline seems to be an integer, I tried to set it as an integer, but it crashed :

    Daté du 24/08/25 21:02:43
    ---------------------------------------------
    Error BASE/1070  Argument error: ==
    Called from (b)HWG_ERRSYS(19)
    Called from HBRUSH:ADD(314)
    Called from HBROWSE:REBUILD(586)
    Called from HBROWSE:PAINT(668)
    Called from HBROWSE:ONEVENT(306)
    Called from HWG_ACTIVATEDIALOG(0)
    Called from HDIALOG:ACTIVATE(186)
    Called from HWG_WCHOICE(170)
    Called from TYPESEARCH(93)
    Called from (b)MAIN(449)
    Called from HOWNBUTTON:MUP(323)
    Called from HOWNBUTTON:ONEVENT(151)
    Called from HWG_ACTIVATEMAINWINDOW(0)
    Called from HMAINWINDOW:ACTIVATE(340)
    Called from MAIN(815)
    
    HWGUI 2.23 dev Build 8
    Date:25/08/24
    Time:21:02:43
    

    How to set it correctly ?

    A+

     

    Last edit: Aupeix Alain 2025-08-24
  • Wilfried Brunken

    Hello Alain,
    i have now problem, on my Ubuntu system, the bug is fixed.
    (see commit r3790, r3792 and screenshot)
    Please check again.

    This parameter represents the size of one line in the BROWSE window.
    This fact is also described in the comment lines of test program.

    The default value of nwline is 21, i get this value by running experimental
    modifications.
    Also the function docu is updated. On Windows, this parameter is ignored.

    hwg_Gettextmetric( hDC ) runs not correct,

    With regards

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2025-08-25

    Nice ... you can close

    Thanks
    A+

     
  • Wilfried Brunken

    • status: open --> closed
     
  • Wilfried Brunken

    Hello Alain,
    ticket closed by your request.
    I will use this function now in my
    program CLLOG as well.

    With regards

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     

Log in to post a comment.

MongoDB Logo MongoDB