Page 1 of 1

window title

Posted: Mon Jun 18, 2012 11:11 am
by t57042
Hello,

I want to change a window title, deciding at runtime which window.
Following code does not work.
Is there a way to do this with an API call?

Richard


Code: Select all

#include "hmg.ch"

Function Main()

   DEFINE WINDOW F1 ;
      AT 0,0 ;
      WIDTH 500 ;
      HEIGHT 400 ;
      MAIN;
      TITLE 'Button Test'

      @ 70,70 BUTTON Button_1 caption "click" WIDTH 50 HEIGHT 50 ACTION title()

   END WINDOW

   CENTER WINDOW F1

   ACTIVATE WINDOW F1

Return
function title()
      win="F1"
     // F1.Title := 'Hello there !!!!!!!!!!!!!!!!!!!'        // OK
     &win.Title := 'Hello there !!!!!!!!!!!!!!!!!!!'       // doesn't work
return      

Re: window title

Posted: Mon Jun 18, 2012 11:23 am
by Rathinagiri
You can use function setProperty( "f1", "TITLE", "New Title" )

Re: window title

Posted: Mon Jun 18, 2012 11:29 am
by t57042
Thank you very much - very simple if one knows!

Is there somewhere a list of all those (easy) functions?

Richard

Re: window title

Posted: Mon Jun 18, 2012 11:32 am
by Rathinagiri
Yes, just read HMG reference from the Doc folder.