|
Post by ptitjoz on Feb 11, 2018 21:54:36 GMT 1
Hello
Little question with HUG how to delete the contents of an EDIT
TEXT(EDIT_BOX,"Hello"&CR$) TEXT(EDIT_BOX,"World"&CR$) I would like to delete the content... I can not find the method
Regards
|
|
|
Post by alexfish on Feb 12, 2018 1:32:19 GMT 1
Hi ptitjoz
HTH
TEXT(EDIT_BOX,"")
BR Alex
|
|
|
Post by ptitjoz on Feb 12, 2018 8:32:11 GMT 1
Hello When I click the Edit add new lines and Edit is not first cleaned... INCLUDE "hug.bac" INIT
SUB AFFICHER TEXT(EDIT_BOX," ") TEXT(EDIT_BOX,"Hello "&CR$) TEXT(EDIT_BOX," World"&CR$&CR$) END SUB
REM Fenêtre principale Mainwin = WINDOW( "Test erase Edit", 300, 200)
EDIT_BOX = EDIT(100, 100) ATTACH( Mainwin, EDIT_BOX, 10, 10)
ButtonAfficher = STOCK("Afficher", 80, 25) ATTACH( Mainwin, ButtonAfficher, 20, 150 ) CALLBACK( ButtonAfficher , AFFICHER)
ButtonQuitter = STOCK("gtk-quit", 80, 25) ATTACH( Mainwin, ButtonQuitter, 120, 150 ) CALLBACK( ButtonQuitter , QUIT)
DISPLAY Best Regards
|
|
|
Post by basica on Feb 12, 2018 19:45:34 GMT 1
Hello When I click the Edit add new lines and Edit is not first cleaned... INCLUDE "hug.bac" INIT
SUB AFFICHER TEXT(EDIT_BOX," ") [font color="e61973"]<-------- should be TEXT(EDIT_BOX,"")[/font] TEXT(EDIT_BOX,"Hello "&CR$) TEXT(EDIT_BOX," World"&CR$&CR$) END SUB
REM Fenêtre principale Mainwin = WINDOW( "Test erase Edit", 300, 200)
EDIT_BOX = EDIT(100, 100) ATTACH( Mainwin, EDIT_BOX, 10, 10)
ButtonAfficher = STOCK("Afficher", 80, 25) ATTACH( Mainwin, ButtonAfficher, 20, 150 ) CALLBACK( ButtonAfficher , AFFICHER)
ButtonQuitter = STOCK("gtk-quit", 80, 25) ATTACH( Mainwin, ButtonQuitter, 120, 150 ) CALLBACK( ButtonQuitter , QUIT)
DISPLAY Best Regards
|
|
|
Post by ptitjoz on Feb 13, 2018 9:59:19 GMT 1
Hi basica
Thanks
I was thinking of an instruction of the type CLEAR(EDIT_BOX) or RESET(EDIT_BOX) etc.
it would be more explicit than not putting anything in a string
Regards
|
|
|
Post by Pjot on Feb 14, 2018 20:55:21 GMT 1
Hi ptitjoz,
The idea of the HUG include is to provide access to GUI programming but with a limited set of functions.
Basically, each widget can SET/GET a value, or TEXT/GRAB$ a string, to or from itself. Very specific low-level properties can be set with PROPERTY.
If you really need other functions, then maybe best is to add a wrapper yourself, or start using GTK directly in your code.
HTH Peter
|
|