I managed to solved it, I just messed around then I thought that I can mimic scrolling by just moving all the GUI Widgets on my windowFrame using MouseScroll button events.
#!BPY
import bpy
import Blender
from Blender import Draw,Window
toggle = 0
scrollby = 0
textInput = Draw.Create("d")
############################################################################
# Blender Recursively calls this functions in order to Redraw the GUI
# Local Values in this functions will be re-initialized for each Function Call
# Store variables in the Global Scope in order to keep values. eg Textbox values
############################################################################
#FunctionNames are not reserved! U can define any name, then Register in Blender.Draw
def drawMe():
global strInput,textInput, toggle
global scrollby
# Toggle(name,event,x,y,width,height,default,"popupTooltip")
textInput = Draw.Create(textInput.val)
Draw.Toggle("Move TextBox",2,200,150 +scrollby, 100,20,toggle,"All Textboxes & values")
print toggle
if toggle == 1:
textInput= Draw.String("Str: ",1,500,200 +scrollby,100,20,textInput.val,20,"its tooltip")
else:
textInput= Draw.String("Str: ",1,200,200 +scrollby,100,20,textInput.val,20,"its tooltip")
#Create TextBox
#WindowGrid position for placed widgets relative to Window size
xPos,yPos = (Window.GetAreaSize()[0], Window.GetAreaSize()[1])
Draw.PushButton("Exit",3,xPos-100,5, 100,20,"All Textboxes & values")
#****Scrollbar
resolution = Blender.Window.GetScreenSize()
screenArea = Blender.Window.GetAreaSize()
mouseCoord = Blender.Window.GetMouseCoords()
#Check if MouseCursor is on top of Scrollbar,
#then use ScreenCoordinates to scroll the Window
inArea = resolution[0]-Blender.Window.GetAreaSize()[0]
if abs(mouseCoord[0] - inArea) < 20:
print (abs(mouseCoord[0] - inArea)), " Mouse=",\
Blender.Window.GetMouseCoords()
scrollby = mouseCoord[1]
myvar = Draw.Scrollbar(0, 0,0, 20, yPos, scrollby,1,500, 0,"Window Scrolling")
#print Blender.Window.GetAreaSize() , " ", Blender.Window.GetMouseCoords()
############################################################################
#Handles system events. Eg. from a keyboard or Mouse
############################################################################
def sysEvent(evt,val):
global scrollby
if evt == Blender.Draw.ESCKEY:
Blender.Draw.Exit()
return
#Increament "scrollby" to Scroll all Widgets on the Window
if evt == Draw.WHEELDOWNMOUSE :
scrollby += 50
#Decreament scrollby ,, ,, ,,
if evt== Draw.WHEELUPMOUSE:
scrollby -= 50
#Refresh the GUI when you move the Mouse
if evt == Draw.MOUSEX:
Draw.Redraw(1)
Draw.Redraw(1)
############################################################################
#EventHandler for all GUI widget evetnts
############################################################################
def guiEvents(eventPassed):
global toggle
if eventPassed == 1:
print None
if eventPassed == 2:
#Draw.UIBlock(drawMe,toggle)
toggle = 1 - toggle
Draw.Redraw(1)
if eventPassed == 3:
Draw.Exit()
Blender.Draw.Register(drawMe,sysEvent,guiEvents)
I tried writing brief comments but feel free to ask anything. :RocknRoll: