ID:2362201
 
(See the best response by Ter13.)
Code:
mob/verb/splitter()
var n = input(src, "number 0-100", "options",50) as num
winset(src, "mainwindow.mainvssplit", "splitter=[n]")


Problem description:

I am using this to test control of the Splitter % with code. But it does not change the splitter %. Why? Thanks.
Hrm, that code should work for all intents and purposes. Are you sure you didn't typo the window name (mainwindow) or the child's name (mainvssplit)?
I triple checked it, it is indeed correct. I'll try it with a new project later and see if it works there.
mob/verb/splitter()
var n = input(src, "number 0-100", "options",50) as num
winset(src, "mainwindow.mainvssplit", "splitter=[n]")
var/v = winget(src,"mainwindow.mainvssplit", "lock;splitter;show-splitter;left;right")
world.log << "\ref[src] \ref[usr]\n[v]"
world.log << winget(src,"mainwindow.*","type;id")


Open the log and copy/paste the output.
In response to Ter13
[0x30002be] [0x30002be]
lock=;splitter=;show-splitter=;left=;right=
mainwindow.type=MAIN;mainwindow.id=mainwindow;mainwindow.mai nvsplit.type=CHILD;mainwindow.mainvsplit.id=mainvsplit
Best response
You named it mainvsplit, but your code is trying to change mainvssplit.

Team7Star wrote:
I triple checked it, it is indeed correct. I'll try it with a new project later and see if it works there.

You done goofed.
Oh lawdy... Thanks.
In response to Team7Star
Team7Star wrote:
Oh lawdy... Thanks.

It's always something tiny. Programming is terrible. =D
In response to Ter13
Ter13 wrote:
It's always something tiny. Programming is terrible. =D

Facts. Literally spent 3 hours the other day debugging a binary heap implementation I wrote. All because of a typo in a bitshift operation: (index - 1) >> 2 instead of (index - 1) >> 1. Life is hard.
Been there, I've had it happen with a damn comma causing hours of debugging.
Number typos are the worst, because they're just enough to make things wrong but not nearly wrong enough to give you a good idea of where it's all going to hell. I had that so many damned times with my integer library and my WIP Mersenne twister library

Login to reply.