Re: [PATCH] blox: Fix fall-out from calling >>#initialize as part of new

<[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
That's helped a lot. Blox starts up and is a useful browser, although
actually adding code thought it seems impossible at the moment.

Although my C is stoneage and my Smalltalk is maybe iron-age, I would be
happy to help in as much as I can, if I can.

Thomas

Holger Hans Peter Freyther writes:

> The code assumes that parentView is set before >>#initialize is
> called and this assumption was broken by the change. In the long
> run it might be best to call this routine >>#initializeView and
> or integrate the setting of the parent view. The patch changes
> the base class to restore the old behavior for creation.
>
> Call >>#initialize on the Workspace so that the variableNames
> tracker is properly initialized. Remove one unneeded call for
> the STInST module.
>
> 2016-01-23  Holger Hans Peter Freyther  <[email protected]>
>
> 	* BrowShell.st: Call >>#initialize.
> 	* DebugSupport.st: Do not call >>#initialize.
> 	* View.st: Use >>#basicNew to instantiate.
>
> 2016-01-23  Holger Hans Peter Freyther  <[email protected]>
>
> 	* BloxBasic.st: Use >>#basicNew to create Gui items.
> ---
>  packages/blox/browser/BrowShell.st    | 1 +
>  packages/blox/browser/ChangeLog       | 6 ++++++
>  packages/blox/browser/DebugSupport.st | 1 -
>  packages/blox/browser/View.st         | 2 +-
>  packages/blox/gtk/BloxBasic.st        | 4 ++++
>  packages/blox/gtk/ChangeLog           | 4 ++++
>  packages/blox/tk/BloxBasic.st         | 4 ++++
>  packages/blox/tk/ChangeLog            | 4 ++++
>  8 files changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/packages/blox/browser/BrowShell.st b/packages/blox/browser/BrowShell.st
> index 3ecba63..4d233cb 100644
> --- a/packages/blox/browser/BrowShell.st
> +++ b/packages/blox/browser/BrowShell.st
> @@ -84,6 +84,7 @@ TopLevelShell subclass: BrowserShell [
>  	| worksheet textView |
>  	worksheet := self new: label.
>  	worksheet addChildView: ((textView := PWorksheetText new: worksheet)
> +		    initialize;
>  		    menuInit: ((PopupMenu new: textView label: 'Edit') 
>  				selectors: #(#('Cut' #gstCut) #('Copy' #gstCopy) #('Paste' #gstPaste) #() #('Clear' #gstClear) #() #('Line...' #line) #('Find...' #find) #() #('Do it' #eval) #('Print it' #evalAndPrintResult) #('Inspect' #evalAndInspectResult) #() #('Senders' #senders) #('Implementors' #implementors))
>  				receiver: textView
> diff --git a/packages/blox/browser/ChangeLog b/packages/blox/browser/ChangeLog
> index a112b85..5e77045 100644
> --- a/packages/blox/browser/ChangeLog
> +++ b/packages/blox/browser/ChangeLog
> @@ -1,3 +1,9 @@
> +2016-01-23  Holger Hans Peter Freyther  <[email protected]>
> +
> +	* BrowShell.st: Call >>#initialize.
> +	* DebugSupport.st: Do not call >>#initialize.
> +	* View.st: Use >>#basicNew to instantiate.
> +
>  2014-07-26  Holger Hans Peter Freyther  <[email protected]>
>  
>  	* PText.st: Remove PWorksheetText class >> #new.
> diff --git a/packages/blox/browser/DebugSupport.st b/packages/blox/browser/DebugSupport.st
> index 4c10518..9292195 100644
> --- a/packages/blox/browser/DebugSupport.st
> +++ b/packages/blox/browser/DebugSupport.st
> @@ -46,7 +46,6 @@ STInST.STInST.RBProgramNodeVisitor subclass: VariableNames [
>  
>  	<category: 'visiting RBSequenceNodes'>
>  	^(self new)
> -	    initialize;
>  	    visitNode: (method parserClass parseMethod: method methodSourceString);
>  	    varNames
>      ]
> diff --git a/packages/blox/browser/View.st b/packages/blox/browser/View.st
> index 527651b..b1470b7 100644
> --- a/packages/blox/browser/View.st
> +++ b/packages/blox/browser/View.st
> @@ -39,7 +39,7 @@ BLOX.Gui subclass: View [
>      View class >> new: aString in: view [
>  	<category: 'instance creation'>
>  	| aView |
> -	aView := self new.
> +	aView := self basicNew.
>  	aView parentView: view.
>  	^aView
>      ]
> diff --git a/packages/blox/gtk/BloxBasic.st b/packages/blox/gtk/BloxBasic.st
> index 2d70bf6..fea2004 100644
> --- a/packages/blox/gtk/BloxBasic.st
> +++ b/packages/blox/gtk/BloxBasic.st
> @@ -39,6 +39,10 @@ Object subclass: Gui [
>  expose an individual protocol but internally use a Blox widget for
>  creating their user interface.'>
>  
> +    Gui class >> new [
> +        ^self basicNew
> +    ]
> +
>      blox [
>  	"Return instance of blox subclass which implements window"
>  
> diff --git a/packages/blox/gtk/ChangeLog b/packages/blox/gtk/ChangeLog
> index 2aa7335..b956cb9 100644
> --- a/packages/blox/gtk/ChangeLog
> +++ b/packages/blox/gtk/ChangeLog
> @@ -1,3 +1,7 @@
> +2016-01-23  Holger Hans Peter Freyther  <[email protected]>
> +
> +	* BloxBasic.st: Use >>#basicNew to create Gui items.
> +
>  2014-07-26  Holger Hans Peter Freyther  <[email protected]>
>  
>  	* BloxText.st: Remove BTextBindings class >> #new.
> diff --git a/packages/blox/tk/BloxBasic.st b/packages/blox/tk/BloxBasic.st
> index 9fcd373..5e78032 100644
> --- a/packages/blox/tk/BloxBasic.st
> +++ b/packages/blox/tk/BloxBasic.st
> @@ -39,6 +39,10 @@ Object subclass: Gui [
>  expose an individual protocol but internally use a Blox widget for
>  creating their user interface.'>
>  
> +    Gui class >> new [
> +        ^self basicNew
> +    ]
> +
>      blox [
>  	"Return instance of blox subclass which implements window"
>  
> diff --git a/packages/blox/tk/ChangeLog b/packages/blox/tk/ChangeLog
> index 159b177..842550d 100644
> --- a/packages/blox/tk/ChangeLog
> +++ b/packages/blox/tk/ChangeLog
> @@ -1,3 +1,7 @@
> +2016-01-23  Holger Hans Peter Freyther  <[email protected]>
> +
> +	* BloxBasic.st: Use >>#basicNew to create Gui items.
> +
>  2014-05-26  Holger Hans Peter Freyther  <[email protected]>
>  
>  	* BloxTK.c: Use Tcl_GetStringResult to access the result.

-- 
Sent with my mu4e
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.