[Wxsqueak] WxSqueak Constants
Rob Gayvert
rtg at rochester.rr.com
Sat Jan 10 14:18:56 UTC 2009
Rob Rothwell wrote:
> First, a newbie question:
>
> How do you get away with using constants directly in WxSqueak like
> wxIdAny, without quotes or an #? I can't figure that one out!
All of the wx classes inherit from WxBase, which has WxConstants as a
pool dictionary. There's a bit of magic here, in that WxConstants is
actually loaded at startup from the VM, so that it gets the correct
values of these constants for the current platform (e.g., some values
are different for Windows vs OS X).
>
> Also, I am just trying to learn how to get around in WxSqueak by
> creating a simple tabbed editor. I can't figure out which event lets me
> know I have switched tabs (pages) so I can give the focus to the text
> editor without having to click in the edit window as well. Any hints?
> The wxWidgets documentation indicates a *EVT_NOTEBOOK_PAGE_CHANGED*
> message, so I was looking for something like wxEvtNotebookPageChanged,
> but it doesn't exist. Just not implemented?
Figuring out which events to use is one of the hardest parts of using
wxWidgets, especially if you're not using a GUI builder. In this case
the documentation references the *macro* EVT_NOTEBOOK_PAGE_CHANGED, but
the actual event is wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED (you have to
keep in mind that the manual is written for C++ programmers).
Take a look at the controls sample, in particular
WxControlsSamplePanel>>setupEvents.
>
> I know these are very basic questions, but there are basic Smalltalk
> things I don't know how to figure out.
Sometimes the most basic questions are the hardest, especially when they
reveal weaknesses in the framework ;)
>
> I keep coming back to this because it is the one UI framework for Squeak
> I seem to be able to understand and figure out on my own...
>
> Thanks,
>
> Rob
More information about the Wxsqueak
mailing list