[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting CTextIn value

>On 21 Jan, Przemyslaw G. Gawronski wrote:
>> I've added the dialog commands in the constructor, and after that I'm
>> trying to set the value of one of the widgets (CTextIn) to a char *
>> passed to the constructor but that dosn't seem to work.
>> After the dialog is displayed it's not a problem, but before ?
>This is an artifact of Windows. I have noticed that this will work fine
>in X windows but not in Windows. My guess is that under X the dialog is
>built at creation time and hence calls to SetText etc. work fine
>before the dialog is displayed but under Windows the dialog is created
>at display time and hence call to SetText have no effect untill the
>dialog has been shown.
>This leads to some pretty ugly work arounds on the dos side of things.
>Have any others come across this annomaly? I consider this to be a
>serious deficiency/bug in the windows implementation.

There is function:

void vDialog::DialogDisplayed()

Manual says:
"This method is called by the V runtime system after a dialog has actually
been displayed on the screen. This method is especially useful to override
to set values of dialog controls with SetValue and SetString.
It is important to understand that the dialog does not get displayed until
ShowDialog or ShowModalDialog has been called. There is a very important
practical limitation implied by this, especially for modal dialogs. The
values of controls cannot be changed until the dialog has been displayed,
even though the vDialog object may exist. Thus, you can't call SetValue or
SetString until after you call ShowDialog for modeless dialogs, or
ShowModalDialog for modal dialogs."

This works!

best regards, Nikolay

Reply to: