[Gambas-user] INITIAL Location of Form

rogerHPH bbg.holfarm at ...2767...
Tue Jan 31 15:35:23 CET 2012


Below is example code.

Using Gambas 2.22 and Ubuntu 11.10

With a Form (FMain) and a Timer (Timer1).

The following code will initially position the Form at the top of the
available screen, but about 2 cm right of the LH edge (i.e. beside the
Ubuntu Program Launcher Toolbar), when it should be fully at Top Left of the
available screen.
After 2 seconds the Form moves to 0,0, correctly, at the Top Left of the
available screen, (pushing the UBUNTU Tool-Bar off the screen to the Left) 
then 2 seconds later it is moved to near the Screen Centre (and the Tool-Bar
re-appears).

If I comment out the code in SUB_new and un-comment the code in SUB_FormOpen
the effect is the same.

Interestingly this still happens even  if I am running GAMBAS in Full-Screen
mode, which has forced the Toolbar off the screen - the Form still starts up
2 cm from the Left-Hand screen edge,  and also if I Compile the program to
an Executable with "Make".

If I start with larger values of X & Y in either _new or _FormOpen (e.g.
200,300) it works correctly.


' Gambas class file
'
'=====================
'   XY_BUG ?  Jan 2012
'=====================


PUBLIC SUB _new()
FMain.X = 0
FMain.Y = 0
Timer1.Delay = 2
Timer1.Enabled = TRUE
END

PUBLIC SUB Form_Open()
  ' FMain.X = 0 
  ' FMain.Y = 0
  ' Timer1.Delay = 2
  ' Timer1.Enabled = TRUE
END


PUBLIC SUB Timer1_Timer()
Timer1.Enabled = FALSE
WAIT 2
FMain.X = 0
FMain.Y = 0
WAIT 2
FMain.X = 400
FMain.Y = 400
END


-- 
View this message in context: http://old.nabble.com/INITIAL-Location-of-Form-tp33224807p33236597.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list