[Gambas-user] How to close a modal dialog form?

Doriano Blengino doriano.blengino at ...1909...
Tue Dec 8 18:03:37 CET 2009


M. Cs. ha scritto:
> Since the language of help documents aren't as clear to me, and I saw no
> practical example I need your help. I would like to have a template message
> dialog with title, text and an image I wrote a subroutine which would do the
> things. It has an OK button upon itself, but I cannot close the window. I
> would like this window to block other forms. How could I do that
>
> PUBLIC SUB Messenger(naslov AS String, tekst AS String, slika AS String)
> DIM imge AS PictureBox
> DIM conti AS TextLabel
> DIM butty AS Button
> keret = NEW Form
> keret.Width = 500
> keret.Height = 300
> keret.Title = naslov
> imge = NEW PictureBox(keret)
> imge.x = 0
> imge.y = 0
> imge.Width = 280
> imge.Height = 280
> imge.Border = TRUE
> imge.Picture = Picture[slika]
> conti = NEW TextLabel(keret)
> conti.x = 300
> conti.y = 20
> conti.Width = 190
> conti.Height = 230
> conti.Text = tekst
> butty = NEW Button(keret)
> butty.x = 340
> butty.y = 250
> butty.Width = 120
> butty.Height = 25
> butty.Text = MessageYes.Text
> keret.Center
> keret.ShowModal()
> Object.Attach(butty, ME, "Ops")
> Message("Hm")
> END
>
> PUBLIC SUB Ops_Click() AS Integer
> keret.Close()
> END
>   
Really not shure, but probably you must attach() before doing showmodal()...
In fact, showmodal is meant to stop the execution until the user closes 
the modal form.

Salut,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list