Open DCowboy opened 2 months ago
Thank you for filing this issue and providing this update, and apologies for the late response. I will look at your code and get back to you soon.
No worries about late responses. I realize that you're busy. I can be patient since my project still has a lot of back end work that needs done too.
I discovered that we actually don't have any code implementing s.Pos
currently, which is why it isn't working. We did at some point and it shouldn't be too hard to implement again. This isn't our highest priority, but we will do it at some point relatively soon, and I can help you get your code working after that. Feel free to ping us again once you have finished more of your back-end work.
Also, just in case you don't already know, if you are making something like a game, you might be better suited using a canvas or SVG widget, in which it is very easy to do these kind of fine-grained dynamic manipulations.
I discovered that we actually don't have any code implementing
s.Pos
currently, which is why it isn't working. We did at some point and it shouldn't be too hard to implement again. This isn't our highest priority, but we will do it at some point relatively soon, and I can help you get your code working after that. Feel free to ping us again once you have finished more of your back-end work.Also, just in case you don't already know, if you are making something like a game, you might be better suited using a canvas or SVG widget, in which it is very easy to do these kind of fine-grained dynamic manipulations.
I understood that. I explained above that my use case is making a ticker. Specifically, one that will be used for a crypto trading tool. reducing multiple browser tabs of information to a small window.
Okay, I understand. We will definitely get this working when we have the time.
Describe the feature
After failing to make what I was interested in clear enough for an off-handed question, and not finding any examples in cogent/cogent that did anything in the realm of what I was looking to do, It was suggested I make a new issue with full details to see the best way to go about it if a good way exists within what's currently supported or to request the feature be supported if need be.
In my specific use case, I'm interested in making a ticker made of buttons within a frame. While I do understand that Cogent is designed differently than other GUI libraries to be smaller faster and more responsive, I only currently know how to explain it in terms of how those other libraries work. So, please bear with me on that.
Using other libraries, this would usually be controlled by defining a tick() function that:
If this were put on a loop, (probably best implemented in a goroutine; given the way Cogent looks to be designed,) it would show continuous movement.
There are lots of use cases where changing a widget's position, size, (or shape- mostly in the case of canvas items,) could be desirable in a Graphic User Interface; whether the changes are brought about by a looped function for constant movement, or another widget like a button's function, or even a key bind.
Is there a good way to go about this type of thing in the current infrastructure?
Update: Upon trying to make things work under the current structure, I seem to have run into an issue just setting initial positions Using NoLayout in a frame that's also using Maker.
Perhaps I'm doing something wrong. I tried a few different ways on my end before heading tot the playground to see if setting up an even simpler version starting from the tree example would work. Yet I got the same results. Here is the playground version:
After I get them initially set up, using the Styler, I'll still have to figure out how to make it conditional so the positions can then be altered when updated. But so far, when in NoLayout, Only button 0 shows when number is greater than 0. I've added a snackbar to the playground to replace the Println I was using in my desktop editor to show at least for the last button, that the position should have been set.
Am I going about this the wrong way?
Or Would now be a good time to suggest a new other type frame widget? Perhaps with a name like XYFrame or a better name as I confess to not being the best at naming things. This frame could then handle all NoLayout scenarios and you could remove that option from regular frames.
XYFrame would automatically be NoLayout. It would need provide easy ways to access it's children's geometry to make it easy for controlling functions and/or the children themselves to reference. It would also be good if it assisted with functions to allow it's children to do things like:
Note the things above are also precursors to the the functions that would also be needed for movement for the X and Y axis movement in XYZ.
Sorry for the long-windedness with this update, but I figured since I was thinking about making the suggestion for an easier way to do things, might as well try to make the suggestion as complete as possible for most common use cases of non-static GUI elements.
Relevant code
No response