New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shoes could have a text_edit widget #144

Open
ccoupe opened this Issue Sep 5, 2015 · 10 comments

Comments

Projects
None yet
4 participants
@ccoupe
Contributor

ccoupe commented Sep 5, 2015

I thought I mentioned this somewhere before but I didn't flag it as an issue. As demonstrated with the new console feature, both Gtk and OSX have the capabilities for a new widget, call it text_edit for now. Looks like a edit_box but has a much different API and implementation.

It would have a insertion point (cursor position sort of) and a Shoes script could append there or move it to some other place in the underlying buffer. It could also enable selection/cut/copy paste of text fragments of the text buffer. That's hard to do with edit_box. Most of the heavy lifting is already done by the native code frameworks but Shoes doesn't have the abstraction or API for that level of control.

It would introduce something the the Shoes 4 folks haven't coded for (yet) but we already do things that they can't like native gems and packaging binaries. Thoughts?

@ccoupe ccoupe added the Wishlist label Sep 5, 2015

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Sep 5, 2015

Contributor

Like GtkTextView ? if so at least for the gtk part it wouldn't add too much to the size of shoes so why not ? i' d say some more functionality for almost free, edit_box could serve as an implementation template and from there add specific functionalities, i think shoes is stable enough to allow that !
But maybe you were thinking at something totally different ...

Contributor

passenger94 commented Sep 5, 2015

Like GtkTextView ? if so at least for the gtk part it wouldn't add too much to the size of shoes so why not ? i' d say some more functionality for almost free, edit_box could serve as an implementation template and from there add specific functionalities, i think shoes is stable enough to allow that !
But maybe you were thinking at something totally different ...

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Sep 5, 2015

Contributor

That's the Gtk widget, yes. OSX NSTextView/NSTextEdit has a lot of the same functionality. Half of the code already exists in the new console stuff. Folks have wanted an easy way to append a string to an edit_box or delete something in the middle of a line (or deal with special key chords). In theory one could even write a Text Editor and turn Shoes into an IDE as well as run time/gui platform but that part is probably not for me to accomplish.

Contributor

ccoupe commented Sep 5, 2015

That's the Gtk widget, yes. OSX NSTextView/NSTextEdit has a lot of the same functionality. Half of the code already exists in the new console stuff. Folks have wanted an easy way to append a string to an edit_box or delete something in the middle of a line (or deal with special key chords). In theory one could even write a Text Editor and turn Shoes into an IDE as well as run time/gui platform but that part is probably not for me to accomplish.

@ccoupe ccoupe added Enhancement and removed Wishlist labels Sep 6, 2015

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Sep 6, 2015

Contributor

I wrote a proposed API at https://github.com/Shoes3/shoes3/wiki/New-widget:-multi_line_box .It'a lot easier to see what it could be used for and how to implement. It's still vague of course. Although the wiki is open to anyone to edit, wiki edits don't notify anyone nor is there a commit to roll back so if you want to talk about the problems with the api please add those comments to this issue. This could solve some of @BackOrder issues.

It might be enough to change Shoes from 3.2 to 3.3 (no need for a git branch).

Contributor

ccoupe commented Sep 6, 2015

I wrote a proposed API at https://github.com/Shoes3/shoes3/wiki/New-widget:-multi_line_box .It'a lot easier to see what it could be used for and how to implement. It's still vague of course. Although the wiki is open to anyone to edit, wiki edits don't notify anyone nor is there a commit to roll back so if you want to talk about the problems with the api please add those comments to this issue. This could solve some of @BackOrder issues.

It might be enough to change Shoes from 3.2 to 3.3 (no need for a git branch).

ccoupe added a commit that referenced this issue Sep 9, 2015

The start of a new native Text Edit widget #144
* Duplicate & modify edit_box to be a new text_edit_box
  Behaves the same for this commit - just different names
* canvas.c|h needs the code for Ruby text_edit_box.new(args)
* ruby.c & .h need cTextEditBox class defines and method call
  DO NOT FORGET CANVAS_DEFS macro
* native.h also needs additions. grrr.
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Sep 11, 2015

Contributor

They Shoes/Ruby interface is written but the Insertion_Point Class and the API needs a rethink based on what people might use it for and how.

Contributor

ccoupe commented Sep 11, 2015

They Shoes/Ruby interface is written but the Insertion_Point Class and the API needs a rethink based on what people might use it for and how.

@jasonrclark

This comment has been minimized.

Show comment
Hide comment
@jasonrclark

jasonrclark Sep 15, 2015

Member

I've often thought that the edit box in Shoes could use some more powerful functions, and this seems like a nice direction for that. I haven't reviewed it in detail, but a lot of the insertion and scrolling seems plausible to me.

That said, the rich styling is likely to be something of a challenge if we stick with bare SWT in Shoes 4. Might be worthwhile to reach for an external library or something to simplify that.

Look forward to seeing how this develops, and I'm hopeful that we could eventually get a Shoes 4 compatible version should this go forward for 3.2.

Member

jasonrclark commented Sep 15, 2015

I've often thought that the edit box in Shoes could use some more powerful functions, and this seems like a nice direction for that. I haven't reviewed it in detail, but a lot of the insertion and scrolling seems plausible to me.

That said, the rich styling is likely to be something of a challenge if we stick with bare SWT in Shoes 4. Might be worthwhile to reach for an external library or something to simplify that.

Look forward to seeing how this develops, and I'm hopeful that we could eventually get a Shoes 4 compatible version should this go forward for 3.2.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Sep 15, 2015

Contributor

@jasonrclark, thanks for commenting. I decided to punt at #146 and just add append() and scroll_to_end() to edit_box because as you note the rich text is quite complex as is managing the insertion point cross platform. Swt may have unified that for all I know.

Contributor

ccoupe commented Sep 15, 2015

@jasonrclark, thanks for commenting. I decided to punt at #146 and just add append() and scroll_to_end() to edit_box because as you note the rich text is quite complex as is managing the insertion point cross platform. Swt may have unified that for all I know.

@jasonrclark

This comment has been minimized.

Show comment
Hide comment
@jasonrclark

jasonrclark Sep 15, 2015

Member

Cool. Once you've added append and scroll_to_end do you think it'd be reasonable to get an issue in on Shoes 4 for creating those for compatibility?

Member

jasonrclark commented Sep 15, 2015

Cool. Once you've added append and scroll_to_end do you think it'd be reasonable to get an issue in on Shoes 4 for creating those for compatibility?

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Sep 16, 2015

Contributor

@jasonrclark , I updated the Shoes 3.2 manual to note that these methods may not be in Shoes 4. The changes are working and committed for 3.2.25 (no date on that yet) and they'll be in the changelog and the announcement email - Oh, that would be a great discussion on the mailing list.

Contributor

ccoupe commented Sep 16, 2015

@jasonrclark , I updated the Shoes 3.2 manual to note that these methods may not be in Shoes 4. The changes are working and committed for 3.2.25 (no date on that yet) and they'll be in the changelog and the announcement email - Oh, that would be a great discussion on the mailing list.

@ccoupe ccoupe added this to the 3.3 milestone Sep 24, 2015

@ccoupe ccoupe modified the milestones: 3.3.1, 3.3.0 Jan 11, 2016

@ccoupe ccoupe removed this from the 3.3.1 milestone Feb 6, 2016

@ccoupe ccoupe referenced this issue Apr 8, 2016

Closed

Better console #236

ccoupe added a commit that referenced this issue Apr 18, 2016

for #236 we can change colors in Gtk_TextView console
* can't handle nested attributes - like setting background and foreground
  and then the text and then changing the background but not the foreground.
* GtkTextMarks and iters may not behave if your doc/coding is different from
  the gtk you compile against.
* doesn't suck too much and I learned a lot which will be useful for #144
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe May 22, 2016

Contributor

Because I need a break from Cocoa debugging on the terminal code, I decided to updated the Proposed text_edit_box. It's more coherent, might even work. Would it solve a problem? I don't know that.

Contributor

ccoupe commented May 22, 2016

Because I need a break from Cocoa debugging on the terminal code, I decided to updated the Proposed text_edit_box. It's more coherent, might even work. Would it solve a problem? I don't know that.

@BackOrder

This comment has been minimized.

Show comment
Hide comment
@BackOrder

BackOrder Mar 13, 2017

Collaborator

The feature is unclear because TextEditBox and EditBox are overly confusing with each other names. GTK calls it GtkTextView and Cocoa calls it NSTextView. How about we call this TextView (text_view) in Shoes?

Collaborator

BackOrder commented Mar 13, 2017

The feature is unclear because TextEditBox and EditBox are overly confusing with each other names. GTK calls it GtkTextView and Cocoa calls it NSTextView. How about we call this TextView (text_view) in Shoes?

BackOrder added a commit to BackOrder/shoes3 that referenced this issue Mar 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment