Skip to content
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

treat the default mode of eventloop thread restriction #48

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

h-nagai
Copy link
Contributor

@h-nagai h-nagai commented Oct 5, 2022

On irb, the default mode of eventloop thread control is "runnable on non-main thread", that is, "Thead.new{Tk.mainloo]" works. Probably irb users would prefer to be able to control widgets interactively.
Otherwise, the default mode is "runnable on the main thread only", because "unnable on non-main thread" requires more processing cost. To make mode selection easier, add a constant ::TK_MAINLOOP_ON_MAIN_THREAD_ONLY. By setting the value of the constant before "require 'tk'", we can select the mode of eventloop.

…non-main thread", that is, "Thead.new{Tk.mainloo]" works. Probably irb users would prefer to be able to control widgets interactively.

Otherwise, the default mode is "runnable on the main thread only", because "unnable on non-main thread" requires more processing cost.
To make mode selection easier, add a constant ::TK_MAINLOOP_ON_MAIN_THREAD_ONLY. By setting the value of the constant before "require 'tk'", we can select the mode of eventloop.
@hsbt
Copy link
Member

hsbt commented Oct 7, 2022

@h-nagai Thanks to your pull-request. I added write permission to you in this repository.

@jeremyevans and others: @h-nagai is the original maintainer of ruby-tk library. There is no reason to not add him to maintainers.

@jeremyevans
Copy link
Contributor

@h-nagai Do you want to merge this and #49? I am planning to make another release soon for #52 and would like to include both of these commits if you think they are ready.

@jeremyevans
Copy link
Contributor

I'm going to merge this now so it can be included in the upcoming release.

@jeremyevans jeremyevans merged commit 628485a into ruby:master Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants