Cabbage Logo
Back to Cabbage Site

Is it possible to detect window size?

  • If you use the pos() identifier then I think the default width and height will be provided instead.
  • I generally use this example from Oeyvind to test slippery comboboxes. And yup, somehow I see them again now in the plugin build. Apologies for this.
  • I’m not sure about the trackfrom idea, that’s why we can set default values for out sliders, so you can have them start anywhere? Or what am I missing?

I’m not sure what you mean…
TestButtons pos(46,2), channel("main-"), namespace("test")?

It’s not about the value and defaults, it’s just about visually where the tracker around the rslider would get drawn. I’ll try to explain it better; here goes:

Currently if I do an rslider with range(-1,1,0) the tracker will already be drawn from -1 to 0… or to whatever other value is selected. In other words, it’s trackfrom(-1) by default.

If it were rslider range(-1,1,0), trackfrom(0) then by default no tracker would be visible at 0, but if you rotate the slider down to -.5 the tracker appears from 0 to -.5. The tracker would always be drawn from 0 to whatever the current value, allowing you to create “symmetrical” trackers around the rslider similar to how the tracker on a vslider with both negative and positive range works.

Yes, I see you point now. I’ll need to take a look at the painting routines and see how easy that might be to implement. I see now you were talking about imported plants with the bounds issue. Did you try using just pos(), we might be lucky :wink:

I honestly have no idea what you mean by using pos()… if you hadn’t meant this:
TestButtons bounds(46,2), channel("main-"), namespace("test")
I also tried this just in case:
TestButtons pos(46,2), channel("main-"), namespace("test")

pos() is also an identifier. You can use it and size() instead of bounds()

rslider pos(10, 10), size(100, 100) ...

I just don’t know if that works with imported plants…

I don’t know why, I’ve never worked with pos/size… only bounds. Doesn’t appear to work with imported widgets tho, like I said, I had tried:
TestButtons pos(46,2), channel("main-"), namespace("test")

That’s what you’re suggesting, right? If this did work tho, it’d achieve what I’m trying to do.

Digging up a fossil here… any thought on the ability to use “pos(x,y)” with imported widgets, letting them inherit their defined sizes?

Forgot this was in the same thread, this was also something that could be very useful to me… a way to quickly define that something will always that the entire available screen real-estate.