-
Notifications
You must be signed in to change notification settings - Fork 19
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
Is there a way to scale applications at scale? #370
Comments
I'm not aware of a zoom capability in the underlying gtk/cocoa and if there is one it may pixelate poorly. The tricky part is rewriting your application to be so dynamically resized - I expect you'll find many moments of grief and a few more shoes bugs. Currently, you can set full screen like a game might do and calculate things based on what it reports for width/height. Manual ->Advanced->app methods |
I concur this assessment. You will have to recalculate everything dynamically for best flexibility or something precalculated. Either way, svg would be the easiest approach but your skill wheel contains lot of bitmaps for which you will have to provide different sizes for each resolution. Shoes is lacking in this area and it has never been a necessity so far. It would sure be a nice feature. For now, you still have the luxury of relative placement which should at least ensure each Shoes component is about the place it should be. They will certainly need to be resized accordingly. Relative placement, resizing according to window size, generate image sets for various resolutions. |
In Tk and Java/awt and Gtk and Cocoa the there is a very flexible relative layout engines. GridBagLayout in Tk and it's the way Gtk3 and Cocoa believe you should do layout instead of the pixel counting that Shoes depends on. How to do that in Shoes with backwards compatibility ? Expert terror-it-tory. |
This is something we should ponder about, re: issue #369 and the future of Shoes. There are probably ways around it considering GTK3 isn't out of thin air, it does have some GTK2 compatibility. Speaking of which... it would be amazing to have Glade support in the future. |
I think ruby-gtk is the proper project for that. I don't see Shoes scaling up to that. If you need that level of control, then you've outgrown Shoes. Here is an interesting starting point for ruby-gtk3 - it even shows connecting the xml defined widgets. Once you outgrow Shoes you have choices with trade-offs - ruby-qt, ruby-wx . It's not an easy jump from 'download and install shoes' and write `Shoes.app {button "hello world" do para "Hello World" end} because you have to install C compilers and Ruby and Gtk/Qt/ and all the other developer things. Here's an example - the layouts in gtk3. Which one does Shoes use - GtkFixed. It's been on deprecation watch for years - As we discovered with freebsd and Gtk 3.20. Implementing Grid in Shoes would be tricky - different co-ordinates but if is there is cocoa equivalent there might by a way to tell Shoes (per top level window) to use something other than GtkFixed. Needs some pondering. |
Consider |
@ccoupe I like your ideas. It might work. The grid itself would get to be sent to shoes_place_decide() but whatever goes inside would be tied in the grid. RE: ruby-gtk3 RE: Glade |
I picked grid because it is sufficiently powerful for just about anything - GtkBox layout is more like Shoes flow/stacks. After some code examination it would be a huge task to remove/hide GtkFixed layout . The cocoa autolayout is even more than complicated. My thought-goal is not to fit shoes widgets into Gtk3 Grid layout, not to make an new GtkFixed thing to be managed by shoes_place_decide(). Either way, there are issues about the canvas behind a Shoes slot so it looks like a complete rewrite/duplication of Shoes internals. Interesting thought experiment but low on the TODO list re: ruby-gtk3 |
Alright I have few questions. If I pick up this GTK thing and try to implement it is it going to be of any help to Shoes? If it is not it will be a put off. I just started a few tests with the slot ratio and I got into a huge party crasher thing. |
hm... I got another idea. Is there a way to resize the application window ? button "resize" do
app.width = 1500
app.height = 1200
end This code does not work as intended but is it possible? |
Not that I know of - but I don't now everything. Do you have resizeable: true in your Shoes.app call? Your app could read a .yaml settings file before the call to Shoes.app so the user could specify the size they want. Pain in the behind. |
Assignments to Shoes.App are always problematic. The way Shoes is built underneath makes it difficult to track variable changes. That's why we get something weird like Have you tried |
Thank you @ccoupe and @backorder but it seems you are right shoes has issues with the main window itself. self.width = is the same as app.width = and it says undefined method for both. Basically what I do when in doubt of what can be possible is debug(self.methods) so I can see all that is possible. There is self.width but no width=. Making everything dynamic failed due to too many issues that come along with it:
I refurbished the application manually for a larger size and this close the issue. Unless you have anything else to add I will close this thread in a day or so :). |
It would be possible to implement Additional references:
|
My first idea was to make it resizeable so users can adjust them as they want but after some tries I saw that slots jiggle not that way I wanted. Then I decided to do a couple of size presets like the games video menus you can choose resolution (800x600, 1024x768 etc) but this had to happen after the application was initialized because the settings menu was part of the app. At the end I ditched this idea as well because if anyone is running 800x600 monitor I doubt he will be able to play Heroes V so he wont need the manual anyways. And then I just had another thought that 800x600 is considered so prehistorically old that I do not have to bother about it so I just did a higher resolution version of the app and ditched all other efforts. |
I agree with your assessment. The good news is that explaining to me gives me an idea: you should support fullscreen. Shoes already support |
I haven't set up everything required to build Shoes on FreeBSD yet. Perhaps @ccoupe can take a look at implementing |
How about |
What sorcery is this I do not see anything in the manual that regards "resize" command. |
Haha! I am suggesting a new Shoes API to fulfill your dreams. :P It's relatively easy to implement. |
As far as it works as intended I like it :D |
- allows to programmatically resize a window - currently fails to resize smaller than the initial window size - reference issue #370
@ccoupe if you could take a look at the latest commit. It is working except when one wants to resize smaller than the initial window size. Right now it does not implement named parameters. |
How did those commits end up at shoes:/shoes instead of shoes3/shoes3? Small enough to copy by hand once I figure out the osx side. |
Isn't it a problem with your mailer again? Seems in order here and on github web interface. So the problem is that it won't resize down and below the initial window size. By the way, there is a commented out |
Here is a little test program. MAXWIDTH = 1600
MAXHEIGHT = 900
Shoes.app(width: 300, height: 100) do
@width, @height = app.width, app.height
stack margin: 10 do
flow do
slider fraction: (@width / MAXWIDTH.to_f) do |s|
@width = (s.fraction * MAXWIDTH)
end
para "width", margin_left: 10
end
flow do
slider fraction: (@height / MAXHEIGHT.to_f) do |s|
@height = (s.fraction * MAXHEIGHT)
end
para "height", margin_left: 10
end
end
animate(24) do
if ((app.width != @width) or (app.height != @height))
app.resize @width, @height
end
end
end |
Looks great :) |
My browser git view must be different than yours. I don't see any pull requests on shoes3/shoes3 - the repo way up top of the us page. That's not an email issue. I suspect we have different git origin definitions I was just looking at shoes_native_app_resized in cocoa..m - It should work. Is this something we deleted the ruby glue to or just another have finished, undocumented surprise? |
It might be the mix of relational and fixed causing this issue. Not so easy to get it right. One sample that gets it right is Shoes Console. Shoes doesn't seem to provide a way to disable scrollbar on Shoes.app. |
Probably not the beta. Many of the OS's handle duplicates badly. |
Alright I managed to go around the hover issue but another one arose that I think will stop me from doing the resize thing. The problem is that it is not a flow but shoes functionality that is not desired. I do not want the user to be able to resize the window manually except with the resize button/listbox I will create. This one is not possible because to be able to resize the app it should have the option resizable: true which also allows the user to do whatever he wants. @ccoupe I have never had issues with this on any versions. Probably I have not removed the old version properly. I will test and let you know. |
Here is a small code to confirm @dredknight statement that Shoes app needs to be resizable to be resized programmatically. Shoes.app(width: 250, height: 100, resizable: false) do
button("resize") do
app.resize 800, 800
end
end One solution would be to implement |
- GTK3 manual recommends using gtk_widget_set_size_request() to resize without geometry constaints. - https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-resize
The latest commit fixes this issue. @dredknight you can continue your work with resizable as true until you get a new beta. GTK makes a clear distinction between a user resizing and code resizing a window. I had initially used Additional references: |
* Shoes.app can now retrieve its position using `x` and `y` methods. * Shoes.app can move the main window and child windows using `move` method. * #64
Hoisted from the #372 commit comments.
Linux, cmd line - any script or -c, -m - any window opening. Dependent on Gtk versions? |
FreeBSD, gtk3-3.22.15_1
|
our gtk3 code needs lots of version checks (#if #else #endif) to deal with my older version, you're newer and windows medium age. Their are preprocessor macros for the versions. We will also have to find/write the equivalent parts. Only going to get worse. |
And so much GTK2 legacy code. It seems gtk_window_set_geometry_hints has some parameters set to NULL since 3.20. |
Not a lot of gtk2 left unless you mean the layout we use - that would be a much different issue. If I read correctly, us older gtk3's will have to supply the geometry_widget arg or go back to the code you used before. |
Actually, it says that |
And my system warning message specifically states things don't match. So I need it to match or otherwise tweek what works for you. Also, Cocoa appears amenable to resize requests but I haven't done the work yet. PS - Hackingtosh is pretty unsatisfactory for any serious Mac work. I have one my Mac for the 10.9 dependencies. Painful. On PC's the different keyboards really becomes an issue. Not worth the effort IMO. |
You surely did this already but perhaps a
It is a fairly standard amongst Windowing APIs.
Not much choice here. Mac mini isn't particularly expensive but need to keep my budget under control, so many other priorities. I will eventually set up a vm and see what kind of contributions I can do on macOS.
Good idea. Absolutely. |
@dredknight how is it going so far? |
It works great. I did the hardest part with the actual wheel because skills/perks dispersion is done with formula and not manually but after that I lost patience to edit lefts, tops, widths and heights of the other stuff so switched to working on another backend for another app (I will show it when ready). Here is some screenshots. Do not mind that dummy resize button that is used for testing. For reference here are the dimensions that are used: |
You are doing really good. I'm glad we found a solution suitable for you. 😃 |
haha glad you like it! It would never happen without your effort ;) |
Hello everyone,
Recently I was asked if it is possible to enable the user to resize my skillwheel application as texts are read hardly on 1920x1200 resolution.
I am aware how scaling goes regarding flows and stacks. You just change width and heights between 0.0 and 1.0 values.
But what about the pictures?
Lets say I have a slot 50x50 with a picture inside. if the slot size increases how can I force the picture inside to increase as well?
What about texts?
As the scale increases the text size remains the same so subjectively it gets smaller compared to slots.
The text was updated successfully, but these errors were encountered: