smalltalk | Promise-based Alert , Confirm and Prompt replacement | Reactive Programming library
kandi X-RAY | smalltalk Summary
kandi X-RAY | smalltalk Summary
Simple Promise-based replacement of native Alert, Confirm and Prompt.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Show a dialog box .
- When a dialog is pressed close it .
- close dialog input
- Change focus on input element
- Generate a template string for message rendering
- Tab - related elements
- Parse button names
- Get the buttons
- Gets the type string for the given options .
- Find elements by name
smalltalk Key Features
smalltalk Examples and Code Snippets
Community Discussions
Trending Discussions on smalltalk
QUESTION
I am having problems to identify where the focus within my application goes to after activating/deactivating or opening/closing some dialogs.
Is there a way to safely get an event down handed down the component hierarchy to be informed when the focus changes and where to?
In a Smalltalk environment for instance, you could for testing reasons just re-implement #requestFocus on Window/SubPane (i.e. JComponent) level and have a debug statement where the focus went.
Can you do something like that in Java or is there a mechanism I am missing?
...ANSWER
Answered 2022-Mar-21 at 16:51I'm not entirely sure what you're trying to do with this, but to answer your question you could add a FocusListener to each element. An avriable is then written using the FocusGained function.
QUESTION
When using gnu smalltalk (without emacs integration) what commands/process does one use to explore the contents of a namespace ? For example, I want to find out how to use the contents of NetClients
but if I just type
NetClients examine
I get an enormous amount of text scrolling past. Is it even possible to pass this into something like less
so I can scroll back and forth through it ? Ideally I'd like to see a list of classes for example, along with their general description. Then for those classes I'd like to be able to see only their selectors.
ANSWER
Answered 2022-Jan-26 at 09:55If you want to search in the text output when sending messages, I would simply redirect the output to file.
I would do the following:
gst -a > netclients_namespace.txt
- type:
NetClients examine
- check the
netclients_nemespace.txt
file where you will have the output of the messages. You can check it while thegst
is still running - If you are done just break it via
ctrl+c
Explaining:
QUESTION
I've very recently started learning Pharo Smalltalk and my first assignment requires me to add three categories to a class, but the problem is that any information I find on the web is written before 2014, and the options are just not there anymore. How can I add categories to classes in Pharo 9.0?
...ANSWER
Answered 2022-Jan-22 at 17:14I presume that the assignment consists in adding categories programmatically. In that case, this is how you could learn how to add a category.
- Find the class you want to add the category to
- Inspect the class and take a look to its instvars
- The categories of the class should be there somehow
- The ivar whose name looks promising is
organization
- Its class is
ClassOrganizer
- Check to see whether there is a
ClassOrganizerTest
for testing it - Found! Take a look at the tests and see if you can find what you are looking for.
QUESTION
I'm new to Smalltalk so I don't know if I'm doing something wrong but this seems very weird and buggy.
...ANSWER
Answered 2021-Dec-10 at 01:17I believe that this is a bug in GNU Smalltalk. It appears that the system allows you to reference variables that have not been defined (this "feature" is not standard) and the system's attempt to define the variables and their scope is having problems.
The work-around is to define your own variables and give them as narrow a scope as possible (this is good practice in any language). So, try the following (validated at here):
QUESTION
I am extremely new to Smalltalk, so please excuse me if I am implementing this solution incorrectly.
I'm reading a table from a txt file that looks like this:
...ANSWER
Answered 2021-Oct-24 at 23:23As Leandro Caniglia mentions in the comments of the post, the problem is that currentRow
is a String, while I was expecting it to be a collection, and therefore, in the columnsCollection
loop, I'm accessing a single character instead of an element from the collection.
The solution was to change how I'm reading in the rows to make sure they are taken as a collection of collections instead of a collection of Strings.
QUESTION
Q1: Coming from an OO background (Java, Ruby, Smalltalk), what would be the preferred way of naming accessor and mutator methods when writing classes in Python? For example if I have:
...ANSWER
Answered 2021-Aug-27 at 21:42AFAIK private attributes aren't as emphasized in Python as other languages. Every attribute is easily accessed, so dedicated getters/setters that get around "private" attributes is mostly honor system. So this would be the go-to:
QUESTION
I have a string an I would like to be able to take a substring from the middle of it. For example for the string 'abcdefg' I want to get 'cde' (but the exact start and stop could be arbitrary). I have found allButFirst:
and allButLast:
messages so I can do it in two steps like
ANSWER
Answered 2021-Jul-10 at 05:43You can use
QUESTION
I found a way to make it work, but it seems clumsy. There has to be a better way...
The question I might try to answer is If I wanted to find out how often a language was selected by country, how would I do that efficiently?
This works, what's better?
...ANSWER
Answered 2021-Apr-13 at 15:05Your tidyverse solution seems pretty good. For something more concise you could try base R or data.table
:
QUESTION
How to convert information from one object's format to another?
In Smalltalk best practice patterns by Kent Beck, he discouraged "adding all the possible protocol needed to every object they may be asked of it". Instead, he suggested to convert from one object to another.
Can someone give me an example of what he meant by "overwhelming object's protocol"? I am trying to understand the bad way to do it in order to be able to appreciate the good way.
...ANSWER
Answered 2021-Mar-26 at 11:33As Beck explains, some clients may need to enumerate a collection in a way that the elements are sorted before exposing them, others would require not iterating twice over the same object (which may appear twice in the collection), etc.
One way to address these situations would be to add methods such as #sortedDo:
, #withoutDuplicatesDo:
, etc. to the collection class. Sooner or later, this approach would derive in populating the class with other variants of #do:
such as #sortedSelect:
, #withoutDuplicatesCollect:
, and the like. The problem is that the resulting protocol of the class would quickly grow too large, adding complexity to the simple task of finding the right selector, increasing the risk of duplicating pieces of code when the search is not exhaustive enough, etc.
To avoid those side effects, the class should provide methods for converting its instances in instances of other classes. So, instead of #sortedDo:
the client may use
QUESTION
I need a static array of structs and the structs contain a Vec. I can manage the lifetimes of the actual values. I get the following error:
...ANSWER
Answered 2021-Mar-24 at 07:35As the compiler tells you, you cannot move a value out of a place observable by others. But since you have the replacement at the ready, you can use std::mem::replace
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install smalltalk
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page