From r.j.rothwell at gmail.com Sat Jan 10 07:28:12 2009 From: r.j.rothwell at gmail.com (Rob Rothwell) Date: Sat Jan 10 07:28:16 2009 Subject: [Wxsqueak] WxSqueak Constants Message-ID: <22f158f00901092328i6781340dw9d1b040a6763aa@mail.gmail.com> 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! 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? I know these are very basic questions, but there are basic Smalltalk things I don't know how to figure out. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/wxsqueak/attachments/20090110/66f7dd0b/attachment.htm From rtg at rochester.rr.com Sat Jan 10 14:18:56 2009 From: rtg at rochester.rr.com (Rob Gayvert) Date: Sat Jan 10 14:19:06 2009 Subject: [Wxsqueak] WxSqueak Constants In-Reply-To: <22f158f00901092328i6781340dw9d1b040a6763aa@mail.gmail.com> References: <22f158f00901092328i6781340dw9d1b040a6763aa@mail.gmail.com> Message-ID: <4968AE50.90703@rochester.rr.com> 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 From r.j.rothwell at gmail.com Sat Jan 10 15:58:43 2009 From: r.j.rothwell at gmail.com (Rob Rothwell) Date: Sat Jan 10 15:58:47 2009 Subject: [Wxsqueak] WxSqueak Constants In-Reply-To: <4968AE50.90703@rochester.rr.com> References: <22f158f00901092328i6781340dw9d1b040a6763aa@mail.gmail.com> <4968AE50.90703@rochester.rr.com> Message-ID: <22f158f00901100758v389793adh8b7011ddc6bbec3a@mail.gmail.com> On Sat, Jan 10, 2009 at 9:18 AM, Rob Gayvert wrote: > Rob Rothwell wrote: > > 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). Ok...so if I want to add my own menu Id's, say, I would use the traditional method of, say, #fileDoSomethingNew... Always the magic...! > >> 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. Late last night (or early this morning), I did find the controls sample, and tried something like: panel on: #wxEvtCommandNotebookPageChanged send: [:evt | tc setFocus. tc setInsertionPoint: 0. evt skip], but still the notebook tab retains the focus. You're right about searching for the proper events; it's VB6 all over again! Sometimes the most basic questions are the hardest, especially when they > reveal weaknesses in the framework ;) On the "VB6" note, how would you recommend wiring controls to your model? I was thinking about doing something like Aida does with the concept of WebElements. You know, create something like a wxCheckBoxElement that does the event handling for you and wires the value of the check to your domain model, and then being able to build new elements containing other elements. Otherwise, it DOES feel very much like standard Windows event driven programming with your code spread out all over the place... However, since I have a background with windows controls, understanding the widgets is easier for me than Morphic widgets, or VW controls, so I think I could actually wrap my mind around wiring a real model to a view--I just thought I'd ask if you found something worked better in your experience! Thank you, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/wxsqueak/attachments/20090110/ee5a4b91/attachment.htm From r.j.rothwell at gmail.com Sat Jan 10 18:37:35 2009 From: r.j.rothwell at gmail.com (Rob Rothwell) Date: Sat Jan 10 18:37:40 2009 Subject: [Wxsqueak] WxSqueak Constants In-Reply-To: <22f158f00901100758v389793adh8b7011ddc6bbec3a@mail.gmail.com> References: <22f158f00901092328i6781340dw9d1b040a6763aa@mail.gmail.com> <4968AE50.90703@rochester.rr.com> <22f158f00901100758v389793adh8b7011ddc6bbec3a@mail.gmail.com> Message-ID: <22f158f00901101037w4a3e4a74k291540f6b544fef3@mail.gmail.com> Ok...I see what you have done...sort of...! You are using "Presenters" and "PluggableWidgets" to do what I asked, I think. Take care, Rob On Sat, Jan 10, 2009 at 10:58 AM, Rob Rothwell wrote: > On Sat, Jan 10, 2009 at 9:18 AM, Rob Gayvert wrote: > >> Rob Rothwell wrote: >> >> 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). > > > Ok...so if I want to add my own menu Id's, say, I would use the traditional > method of, say, #fileDoSomethingNew... > > Always the magic...! > > > >> >>> 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. > > > Late last night (or early this morning), I did find the controls sample, > and tried something like: > > panel on: #wxEvtCommandNotebookPageChanged send: [:evt | tc setFocus. > tc setInsertionPoint: 0. evt skip], but still the notebook tab retains the > focus. You're right about searching for the proper events; it's VB6 all > over again! > > Sometimes the most basic questions are the hardest, especially when they >> reveal weaknesses in the framework ;) > > > On the "VB6" note, how would you recommend wiring controls to your model? > I was thinking about doing something like Aida does with the concept of > WebElements. You know, create something like a wxCheckBoxElement that does > the event handling for you and wires the value of the check to your domain > model, and then being able to build new elements containing other elements. > > Otherwise, it DOES feel very much like standard Windows event driven > programming with your code spread out all over the place... > > However, since I have a background with windows controls, understanding the > widgets is easier for me than Morphic widgets, or VW controls, so I think I > could actually wrap my mind around wiring a real model to a view--I just > thought I'd ask if you found something worked better in your experience! > > Thank you, > > Rob > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/wxsqueak/attachments/20090110/74f3c6fd/attachment.htm