[Gambas-user] A couple of questions
kschrock at ...149...
Wed Jun 4 05:23:15 CEST 2003
Benoit Minisini wrote:
>Le Mardi 3 Juin 2003 23:35, Ken Schrock a écrit :
>>Can I "send" an event? (like Win PostMessage)
>>i.e. Can I call Button1_Click() if I have no sub (code) for it?
>>(more useful real things would be select something in a listbox
>> or perhaps drop down the list in a combo box programmatically)
>>If so how? (It is often helpful to do this asynchronous)
>You can raise a event from a class if you tell gambas that this class can
>raise events with the EVENT keyword.
Thanks, but here's the problem (perhaps I missed something)
The subs (callbacks, whatever) execute synchronously
No events are processed until the sub ends
So if I do
The dialog erases the window
The GrabForm() grabs a blank window
Even if you put Form1.Refresh between the two line
It still gets a blank window as the refresh doesn't happen until the sub
Calling a created event from here does no good as it isn't processing
Wait doesn't release like sleep() does
There seems to be a DoEvent like VB
PostMessage (or something similar)
Allows you to put an event in the queue to be called later
After the other events have finally finished processing
Post a refresh, post a print routine (created event)
And it all happens in the right order
I have several other examples, but you get the idea
I have found workarounds in each situation, but
Something like PostMessage would be easier
(or emit, or signal or whatever semantics)
>EVENT MyEvent(MyParam AS String) AS Boolean ' event declaration
>' Somewhere in a function
>Result = MyEvent("Test")
>DIM hTest AS MYClass
>hTest = NEW MyClass AS "Test"
>PUBLIC FUNCTION Test_MyEvent(sParam AS String) AS Boolean
>>I see people ask for MDI things
>>Why wouldn't the tabstrip work for this type of thing?
>>Spreadsheets and browsers both use this paradigm now
>>It seems neater and more organized than MDI
>The TabStrip of QT are not practical when they have too many tabs, because you
>must to click many times on two little arrow buttons to access each tab. This
>is a complaint of Konqueror users since they can browse with tabs, and I
>think this widget will be rewritten under the users pressure.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User