New problem with Spec.

Layout consists of menu and custom control (subclass of Morph created by 
asSpecAdapter):
initializeWidgets
        menu := self instantiate: MenuModel.    
        self setupMenu.
        menu applyTo: self.
        locationField := LocationFieldMorph new asSpecAdapter.

defaultSpec
        <spec: #default>
        ^ SpecLayout composed
                newColumn:
                        [ :col | 
                        col
                                add: #menu height: self toolbarHeight;          
                
                                add: #locationField 
                        ] yourself

My custom control doesn't automatically resize to fill the area reserved to it 
by layout spec.
I've tried different existed controls instead of mine but didn't find any 
solution. Some controls resized (TextModal) some didn't (Morph, BorderedMorph, 
EllipseMorph). 

I did a dirty hack: in onDraw: of my custom control i set bounds: to aCanvas 
clipRect and it works fine.

drawOn: aCanvas
        self bounds: aCanvas clipRect .
        .... other code ....

But i think it is a wrong solution and there is somewhere a simple property to 
setup ( or something like it ).

Any ideas?


On Thu, 3 Nov 2016 05:28:25 -0700 (PDT)
"stepharo [via Smalltalk]" <ml-node+s1294792n4921278...@n4.nabble.com> wrote:

> 
> 
> 
> 
> Le 2/11/16 à 22:43, vikenti a écrit :
> > Hello, i'm newbie in Pharo, converted from Visual Works which is quite
> > different from Pharo Smalltalk.
> > I started to port my application (i've been working on for about three
> > years) from VW (because of new personal user licensing limitations of Visual
> > Works), but i have to solve some problems and need your advice.
> >
> > These ase some of the most important problems:
> > 1.  I need to rewrite the whole GUI from scratch. What UI framework to
> > choose and where to get documentation? Please, don't send me to research
> > code examples instead of docs - i do this during whole last week. The
> > example should be complete and simple: one task - one example, all examples
> > i've seen are either not applicable to real life or too complicated to
> > understand.
> >   - I need simple window with menu (how to attach menu items to menu
> > handlers???? - no answer in examples)
> >   - Toolbar with icons (how????????)
> >   - components (as i understand - Morphic subclasses, it is the simplest
> > part)
> >   - when window opens i need handler to do some setup actions. Handler 
> > should
> > fire after UI is built and my app's window is opened (how?????)
> >   - i need another handler, which fires when you try to close Pharo or
> > application's window. Handler must check whether to close window or not and
> > do allow or not to close my application.
> >   - how to programmatically close window??????
> >
> > 2. The next task is to do some work on image load (i mean pharo image). I
> > need some handler which fires immediately after image is loaded. How to
> > include my handler in this chain???? My app saves data into the image so i
> > need to manage this and auto-load _my_ application after startup.
> look for startup or startUp or startUpList
> 
> > 3. How to drag-n-drop from the host operation system into pharo application
> > and vice versa? I need to drag-n-drop a list of files from\to file browser.
> I do not remember but there is a way to do that.
> For example when you drop a .cs file it gets loaded.
> > 4. Application deployment. How to strip the unnecessary code from the image?
> > I've heard there is "small image" to add all-i-need-to-run. Where i can
> > download it and how to use it????
> 
> - Do you need to strip your image?
> - for the small image we are producing one but I'm not sure that you 
> want to lose your time with it right now.
> 
> Stef
> 
> >
> >
> >
> >
> >   
> >
> >
> >
> >
> > --
> > View this message in context: 
> > http://forum.world.st/Pharo-desktop-UI-tp4921212.html
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
> >
> 
> 
> 
> 
> 
> 
> _______________________________________________
> If you reply to this email, your message will be added to the discussion 
> below:
> http://forum.world.st/Pharo-desktop-UI-tp4921212p4921278.html
> 
> To unsubscribe from Pharo desktop UI, visit 
> http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4921212&code=dmlrZW50aS5wb3RhcG92QGdtYWlsLmNvbXw0OTIxMjEyfDIxNDcxNTYzMTI=


-- 
С уважением,
Викентий Потапов

http://vikenti.ru
тел.: +7 (917) 880 25 07 (г. Казань)




--
View this message in context: 
http://forum.world.st/Pharo-desktop-UI-tp4921212p4921830.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to