in reply to Change readonly status of Win32::GUI::RichEdit

The read/write ability is an attribute of the control (the widget), not the text itself. I'm not familiar with the perl bindings here, so I don't know if ->articletext-> refers to the widget, or the text.

The WS_ stands for Window Style, a Win32 staple constant. You should be able to adjust that style at runtime, but you will need to tell the control that the style has changed. Typically, both tasks are done at once with a special method (message) you invoke on the control itself, but in a pinch, there's a generic "style changed" message.

Again, not familiar with the Win32:: perl binding module, but that's a meager start. The docs I've seen are not particularly helpful, either.

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re^2: Change readonly status of Win32::GUI::RichEdit
by ChrisR (Hermit) on Feb 11, 2005 at 19:42 UTC
    Just for clarification:

    $mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VISIBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-left=>10,-top=>35,-readonly=>1);
    Is used to create the object/control/widget
    The -name=>'articletext' option gives the object its name.

    The following is used to modify the object (or at least that is what i had hoped it would do).
    $mainform->tab->Page4->articletext(-readonly=>0);

    Here is a breakdown of the objects:
    $mainform = The main window object
    $mainform->tab = tab object within $mainform
    $mainform-tab->Page4 = a page object within $mainform->tab
    $mainform->tab->Page4->articletext = The RichEdit control (widget) within $mainform-tab->Page4

    I have tried using the Refresh method to inform the system of the change, however that didn't work either.