help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] [VisualGST] Smalltalk commands refactored


From: Gwenaël Casaccio
Subject: Re: [Help-smalltalk] [VisualGST] Smalltalk commands refactored
Date: Mon, 17 Jun 2013 21:23:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

On 17/06/2013 17:28, Holger Hans Peter Freyther wrote:
On Mon, Jun 17, 2013 at 02:20:01PM +0200, Gwenaël Casaccio wrote:
Here is the new version of it (without the copyright header changes).
Thanks. For renames like these you might also want to help git format-patch
and pass the -M option to it. And the patch starts to be easily reviewable.
You have replaced precondition with valid.. removed the undo.. and renamed
the redo to execute.

diff --git a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st 
b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st
index 996669e..f7c06a2 100644
--- a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st
+++ b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st
@@ -74,11 +74,11 @@ Command subclass: AcceptItCommand [
        <category: 'command'>
target state hasSelectedCategory ifFalse: [ ^ self acceptClassDefinition ].
-        (AddMethodUndoCommand
+        SysAddMethodCommand
            add: target sourceCode
            classified: target state category
            in: target state classOrMeta
-           browser: target) push
+           browser: target

when/how is this command executed now?

+    execute [
+       <category: 'events'>
+
+       newClass := parentClass subclass: newClassName environment: namespace.
+       namespace at: newClass name put: newClass.
+        newClass category: classCategory fullname.

mixing tabs and spaces?


diff --git a/packages/visualgst/Gtk/GtkEntry.st 
b/packages/visualgst/Gtk/GtkEntry.st
new file mode 100644
index 0000000..fc34fdb
--- /dev/null
+++ b/packages/visualgst/Gtk/GtkEntry.st
@@ -0,0 +1,9 @@
+GTK.GtkEntry extend [
+
+    getText [
+
+        ^ self getBuffer getText
+    ]
+
+]
+
diff --git a/packages/visualgst/Gtk/GtkEntryBuffer.st 
b/packages/visualgst/Gtk/GtkEntryBuffer.st
new file mode 100644
index 0000000..eceb980
--- /dev/null
+++ b/packages/visualgst/Gtk/GtkEntryBuffer.st
@@ -0,0 +1,9 @@
+GTK.GtkEntryBuffer extend [
+
+    getText [
+
+        <cCall: 'gtk_entry_buffer_get_text' returning: #string args: #( #self 
#cObject )>
+    ]
+
+]

I think these belong to another patch?

Ok I've fixed the issue and splitted the patch

Cheers,
Gwen

Attachment: 0001-Refactor-some-Smalltalk-undo-commands-make-them-subc.patch
Description: Text Data

Attachment: 0002-Add-a-primitive-for-retrieving-the-GtkEntryBuffer-te.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]