mIRC Home    About    Download    Register    News    Help

Print Thread
#265019 15/02/19 07:29 PM
Joined: Feb 2017
Posts: 24
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2017
Posts: 24
how to check if nicklist has srollbar and no has scrollbar?

M
Matt5150
Matt5150
M
Hello,
Sorry for my bad english, it's not my native language.
I did a very rough way. You can check if there are more nicknames in a channel than the height of the window / vertical spacing.
For example, I'm using the font Verdana, size 13. The vertical spacing is 17 (so if the window height is 170, there are 10 lines).
So just edit the 17 according to your font size.
Code:
alias chscrollbar {
  if ($nick(#,0) >  $calc($window(#).dh / 17)) { return $true }
  else { return $false }
}

I hope you understand what I mean.
~cheers

EDIT: I don't know if there is a native way (or a better way) to do that, I tested this and looks like it works

#265037 19/02/19 01:51 AM
Joined: Feb 2003
Posts: 2,737
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,737
use $height() instead of 17.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
M
Matt5150
Matt5150
M
Uh thanks for the help @Raccoon, I didn't know that identifier.
So something like $height(a,$window(#).font,$window(#).fontsize) should give you the current and correct height, right?

#265046 20/02/19 08:41 PM
Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
looks like something closer to this is working

Code:
//var -s %a $window( # ).dh , %b $height(a,$window($active).font,$window( # ).fontsize) | echo -a $calc( %a / %b )


Last edited by maroon; 20/02/19 11:23 PM.

Link Copied to Clipboard