Help with Cintilla structures

Just starting out? Need help? Post your questions and find answers here.
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

Help with Cintilla structures

Post by Nonproductive »

Ok, I clearly don't know what i'm doing here...
What I am trying to do is grab the hotspot styled word the user clicks on and copy it to a string gadget. But I don't understand how to access the strucures properly. Here is my code:

Code: Select all

;---- #SCN_HOTSPOTCLICK
  Case #SCN_HOTSPOTCLICK
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)

;--problems between here      
      *SCCharacterRange\cpMax = WrdEnd.l
      *SCCharacterRange\cpMin = WrdStart.l      
      ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCTextRange)
      clicked_text.s= *SCTextRange\lpstrText
;-- and here

      SetGadgetText(#SrchID,clicked_text) 
Anyone that can offer some guidance?
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Post by citystate »

not knowing all of your variables, could it be a confusion between
*SCTextRange and *SCCharacterRange?
failing that perhaps you need to do something like this...

Code: Select all

ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, @*SCTextRange)
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

structure names

Post by Nonproductive »

actually - SCCharacterRange and SCTextRange are predefined structures... they are the ones I'm having trouble with :(

From what I understand of the usage - i need to populate cpMax and cpMin with the start and end of the range I want to get... then call #SCI_GETTEXTRANGE

I actually get an error during compilation that the 'variable' *SCCharacterRange (and *SCTextRange) doesn't have a structure.

I assume I am either accessing them wrong, or I'm using the wrong predefined structure names. The latter doesn't seem to be the case, so I assume the problem is my inexperience with these things.

I also don't think they need to be pointers...but not sure there either...
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

Think 1 problem solved...

Post by Nonproductive »

I need to declare an instance of the structure and use that - like so:

Code: Select all

  *SCICharRange.SCCharacterRange
  *SCITextRange.SCTextRange

now, if I can figure out how to get the string populated, I think it will work...

Code: Select all

clicked_text.s= *SCITextRange\lpstrText
does not return a string....
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

getting closer...

Post by Nonproductive »

This compiles without errors...but I am not getting the string I clicked...so I'm still doing something wrong.

Code: Select all

  SCICharRange.SCCharacterRange
  SCITextRange.SCTextRange

;---- #SCN_HOTSPOTCLICK
  Case #SCN_HOTSPOTCLICK
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)
      
      SCICharRange\cpMax = WrdEnd.l
      SCICharRange\cpMin = WrdStart.l
      
      ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCITextRange)
      clicked_text.s= PeekS(@SCITextRange\lpstrText,WrdEnd-WrdStart)
      SetGadgetText(#SrchID,clicked_text)

Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

not getting it...

Post by Nonproductive »

Let me ask the question differently, because I'm at a loss...
Given these two, predefined structures:

Code: Select all

Structure SCCharacterRange
  cpMin.l
  cpMax.l
EndStructure

Structure SCTextRange
  chrg.SCCharacterRange
  *lpstrText.b
EndStructure
How would you read/write to them?
What I have tried is below - but I am not getting the lpstrTEXT value.
Am I not accessing the SCTextRange structure properly?
I can get values into cpMin and cpMax - but lpstrText is always 0

Code: Select all

Case #SCN_HOTSPOTCLICK
    SCTxtRng.SCTextRange
    SCCharRng.SCCharacterRange
    
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)
      
      SCCharRng\cpMax = WrdEnd.l
      SCCharRng\cpMin = WrdStart.l
      
      ScintillaSendMessage (#SciID, #SCI_SETSEL, WrdStart, WrdEnd)


      txtLen.l = ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCTxtRng)
          
      Debug (Str(WrdStart) + " " + Str(WrdEnd) + " " + Str(txtLen))
      
      clicked_text.s= PeekS(@SCTxtRng\lpstrText, txtLen)
      SetGadgetText(#SrchID,clicked_text)
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: not getting it...

Post by Demivec »

Nonproductive wrote:Let me ask the question differently, because I'm at a loss...
Given these two, predefined structures:

Code: Select all

Structure SCCharacterRange
  cpMin.l
  cpMax.l
EndStructure

Structure SCTextRange
  chrg.SCCharacterRange
  *lpstrText.b
EndStructure
How would you read/write to them?
What I have tried is below - but I am not getting the lpstrTEXT value.
Am I not accessing the SCTextRange structure properly?
I can get values into cpMin and cpMax - but lpstrText is always 0

Code: Select all

Case #SCN_HOTSPOTCLICK
    SCTxtRng.SCTextRange
    SCCharRng.SCCharacterRange
    
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)
      
      SCCharRng\cpMax = WrdEnd.l
      SCCharRng\cpMin = WrdStart.l
      
      ScintillaSendMessage (#SciID, #SCI_SETSEL, WrdStart, WrdEnd)


      txtLen.l = ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCTxtRng)
          
      Debug (Str(WrdStart) + " " + Str(WrdEnd) + " " + Str(txtLen))
      
      clicked_text.s= PeekS(@SCTxtRng\lpstrText, txtLen)
      SetGadgetText(#SrchID,clicked_text)
Use this instead:

Code: Select all

clicked_text.s= PeekS(SCTxtRng\lpstrText, txtLen)
Why lpstrText would be zero I am not sure, you don't seem to be debuggin that value.
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

no luck :(

Post by Nonproductive »

I appreciate the help Demivec, but no luck. :(

that change results in the program terminating at that line with an error that the memory address is null.

I think my problem is with how I am accessing the structures - txtLen is always zero (should return the length of the selected string) which leads me to believe I am not accessing the SCTextRange structure - or populating cpMIN/cpMAX into the wrong structure.
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: no luck :(

Post by Demivec »

Nonproductive wrote:I appreciate the help Demivec, but no luck. :(

that change results in the program terminating at that line with an error that the memory address is null.

I think my problem is with how I am accessing the structures - txtLen is always zero (should return the length of the selected string) which leads me to believe I am not accessing the SCTextRange structure - or populating cpMIN/cpMAX into the wrong structure.
You create an extra structure that you're storing the information in instead of the correct one (I think). Try these changes:

Code: Select all

Case #SCN_HOTSPOTCLICK
    SCTxtRng.SCTextRange
    ;SCCharRng.SCCharacterRange ;CHANGED structure not used
   
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)
     
      SCTxtRng\char\cpMax = WrdEnd.l ;CHANGED to point to correct structure
      SCTxtRng\char\cpMin = WrdStart.l ;CHANGED to point to correct structure
     
      ScintillaSendMessage (#SciID, #SCI_SETSEL, WrdStart, WrdEnd)


      txtLen.l = ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCTxtRng)
         
      Debug (Str(WrdStart) + " " + Str(WrdEnd) + " " + Str(txtLen))
     
      clicked_text.s= PeekS(SCTxtRng\lpstrText, txtLen) ;CHANGED
      SetGadgetText(#SrchID,clicked_text)
    
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

This shouldn't be so difficult!

Post by Nonproductive »

Still not working.

Ok, here is a complete working test app - except for the problem being discussed here... Still can't get the clicked text into a string gadget :(

I can't believe how much head scratching this is causing!


Change how the Scintilla control is initialized depending on whether you have the static library is installed or not.

Code: Select all


;---- Initialize Scintilla DLL
; If InitScintilla("scintilla.dll") = #False
;  MessageRequester("Error","Scintilla.DLL Did not load",0)
;  End
; EndIf
; 
 InitScintillaStaticFull()

#SCI_INDICATORFILLRANGE = 2504
#SCI_INDICATORCLEARRANGE = 2505
#SCI_SETINDICATORVALUE = 2502
#SCI_SETINDICATORCURRENT = 2500


Enumeration
  #SciID
  #SrchID
EndEnumeration

Enumeration 0
    #LexerState_Space
    #LexerState_Click
  EndEnumeration


Procedure Highlight(EditorGadget.l, startpos.l, endpos.l)
    If startpos = -1
        endstyled.l = ScintillaSendMessage (#SciID, #SCI_GETENDSTYLED)
        linenumber.l = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, endstyled)
    Else
        linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, startpos)
    EndIf

    CurrentPos.l = ScintillaSendMessage (#SciID, #SCI_POSITIONFROMLINE, linenumber)
    ScintillaSendMessage (#SciID, #SCI_STARTSTYLING, CurrentPos, $1F | #INDICS_MASK)
    state = #LexerState_Space

    startkeyword = CurrentPos
    keyword.s = ""
    prevChar.l=''
    inClick.b=#False

    While CurrentPos <= endpos
        oldstate = state
        Char.l = ScintillaSendMessage (#SciID, #SCI_GETCHARAT, CurrentPos)
        If Char = '@' And prevChar = ' '
            inClick=#True
            state = #LexerState_Click
        ElseIf Char = 10 Or Char = 13
            inClick=#False
            state = #LexerState_Space
        ElseIf inClick=#True And Char <> ' '
              state = #LexerState_Click
              keyword+Chr(Char)
            ElseIf Char = 9 Or Char = ' ' Or Char = '.'
              state = #LexerState_Space
              inClick=#False
            Else
              state = #LexerState_Space
              inClick=#False
            EndIf
        If oldstate <> state Or CurrentPos = endpos
           ScintillaSendMessage (#SciID, #SCI_SETSTYLING, CurrentPos - startkeyword, oldstate)
           startkeyword = CurrentPos
        EndIf

        If Char = 10 Or CurrentPos = endpos
            linenumber + 1
        EndIf

        CurrentPos + 1
        prevChar=Char
    Wend
EndProcedure

Procedure ScintillaCallBack(EditorGadget.l, *scinotify.SCNotification)
  result.l = 0
  Select *scinotify\nmhdr\code
;---- #SCN_HOTSPOTCLICK
  Case #SCN_HOTSPOTCLICK
    SCTxtRng.SCTextRange
    ;SCCharRng.SCCharacterRange ;CHANGED structure not used
   
      Position = *scinotify\Position
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position)
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1)
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1)
     
      SCTxtRng\chrg\cpMax = WrdEnd.l ;CHANGED to point to correct structure
      SCTxtRng\chrg\cpMin = WrdStart.l ;CHANGED to point to correct structure
     
      ScintillaSendMessage (#SciID, #SCI_SETSEL, WrdStart, WrdEnd)


      txtLen.l = ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, *SCTxtRng)
         
      Debug (Str(WrdStart) + " " + Str(WrdEnd) + " " + Str(txtLen))
     
      clicked_text.s= PeekS(@SCTxtRng\lpstrText, txtLen) ;CHANGED
      SetGadgetText(#SrchID,clicked_text)

;---- #SCN_STYLENEEDED
    Case #SCN_STYLENEEDED
      Highlight(EditorGadget, -1, *scinotify\Position)
      EndSelect

  
  ProcedureReturn result
  
EndProcedure
;---- OpenWindow(0)
OpenWindow(0, 0, 0, 600, 400, "Task List", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)

CreateMenu(0, WindowID(0))
MenuTitle("File")
MenuItem(1, "Quit")

CreateGadgetList(WindowID(0))
  StringGadget(#SrchID, 5, 5, 570, 16, "Search",#PB_String_BorderLess)
  ScintillaGadget(#SciID, 5, 27, 590, 348, @ScintillaCallBack())
  SetGadgetColor(#SrchID, #PB_Gadget_FrontColor, $C0C0C0)
  
;---- Choose a lexer
ScintillaSendMessage (#SciID, #SCI_SETLEXER, #SCLEX_CONTAINER, 0)

;---- Set default font
ScintillaSendMessage (#SciID, #SCI_STYLESETFONT, #STYLE_DEFAULT, @"Courier New")
ScintillaSendMessage (#SciID, #SCI_STYLESETSIZE, #STYLE_DEFAULT, 8)
ScintillaSendMessage (#SciID, #SCI_STYLECLEARALL)

;---- Set styles for custom lexer
ScintillaSendMessage (#SciID, #SCI_STYLESETFORE, #LexerState_Click, $EE0000)
ScintillaSendMessage (#SciID, #SCI_STYLESETFONT, #LexerState_Click, @"Tahoma")
ScintillaSendMessage (#SciID, #SCI_STYLESETSIZE, #LexerState_Click, 10)
ScintillaSendMessage (#SciID, #SCI_STYLESETHOTSPOT, #LexerState_Click, #True)


;---- Set some sample text
text.s = "The clickable text is blue" + #CRLF$
text + "Click these : @clickme or @clickmeinstead" + #CRLF$
ScintillaSendMessage (#SciID, #SCI_SETTEXT, 0, @text)
SetActiveGadget(#SciID)

RemoveKeyboardShortcut(0, #PB_Shortcut_Tab)
RemoveKeyboardShortcut(0, #PB_Shortcut_Tab | #PB_Shortcut_Shift)
;---- Event Loop
quit.l = #False
Repeat
  event.l = WaitWindowEvent()
  GadgetID = EventGadget()
    Select event
        Case #PB_Event_CloseWindow
            quit = #True
        Case #PB_Event_Menu
            Select EventMenu()
                Case 1 : quit = #True
            EndSelect
    EndSelect
Until quit

; IDE Options = PureBasic 4.10 (Windows - x86)
; CursorPosition = 239
; FirstLine = 214
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

First let me say that I have zero experience with Scintilla and I got help from this post by akee...
http://www.purebasic.fr/english/viewtop ... 679#128679

I made a few changes to your code (look for the Sparkie was here comments) and it seems to work now. I had to change the lpstrText member of the SCTextRange structure from .b to .l to get this to work. Is that a PB bug or not, I don't know. ;)

Code: Select all

;---- Initialize Scintilla DLL 
If InitScintilla(#PB_Compiler_Home + "compilers\scintilla.dll") = #False 
  MessageRequester("Error","Scintilla.DLL Did not load",0) 
  End 
EndIf 
; 
;InitScintillaStaticFull() 

;.......................Sparkie was here ........................
Structure _SCTextRange 
 chrg.SCCharacterRange 
 lpstrText.l
EndStructure 
;.................................................................

#SCI_INDICATORFILLRANGE = 2504 
#SCI_INDICATORCLEARRANGE = 2505 
#SCI_SETINDICATORVALUE = 2502 
#SCI_SETINDICATORCURRENT = 2500 

Enumeration 
  #SciID 
  #SrchID 
EndEnumeration 

Enumeration 0 
  #LexerState_Space 
  #LexerState_Click 
EndEnumeration 


Procedure Highlight(EditorGadget.l, startpos.l, endpos.l) 
  If startpos = -1 
    endstyled.l = ScintillaSendMessage (#SciID, #SCI_GETENDSTYLED) 
    linenumber.l = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, endstyled) 
  Else 
    linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, startpos) 
  EndIf 
  
  CurrentPos.l = ScintillaSendMessage (#SciID, #SCI_POSITIONFROMLINE, linenumber) 
  ScintillaSendMessage (#SciID, #SCI_STARTSTYLING, CurrentPos, $1F | #INDICS_MASK) 
  state = #LexerState_Space 
  
  startkeyword = CurrentPos 
  keyword.s = "" 
  prevChar.l='' 
  inClick.b=#False 
  
  While CurrentPos <= endpos 
    oldstate = state 
    Char.l = ScintillaSendMessage (#SciID, #SCI_GETCHARAT, CurrentPos) 
    If Char = '@' And prevChar = ' ' 
      inClick=#True 
      state = #LexerState_Click 
    ElseIf Char = 10 Or Char = 13 
      inClick=#False 
      state = #LexerState_Space 
    ElseIf inClick=#True And Char <> ' ' 
      state = #LexerState_Click 
      keyword+Chr(Char) 
    ElseIf Char = 9 Or Char = ' ' Or Char = '.' 
      state = #LexerState_Space 
      inClick=#False 
    Else 
      state = #LexerState_Space 
      inClick=#False 
    EndIf 
    If oldstate <> state Or CurrentPos = endpos 
      ScintillaSendMessage (#SciID, #SCI_SETSTYLING, CurrentPos - startkeyword, oldstate) 
      startkeyword = CurrentPos 
    EndIf 
    
    If Char = 10 Or CurrentPos = endpos 
      linenumber + 1 
    EndIf 
    
    CurrentPos + 1 
    prevChar=Char 
  Wend 
EndProcedure 

Procedure ScintillaCallBack(EditorGadget.l, *scinotify.SCNotification) 
  result.l = 0 
  Select *scinotify\nmhdr\code 
    ;---- #SCN_HOTSPOTCLICK 
    Case #SCN_HOTSPOTCLICK 
      SCTxtRng._SCTextRange 
      ;SCCharRng.SCCharacterRange ;CHANGED structure not used 
      
      Position = *scinotify\Position 
      linenumber = ScintillaSendMessage (#SciID, #SCI_LINEFROMPOSITION, Position) 
      WrdEnd.l = ScintillaSendMessage (#SciID,#SCI_WORDENDPOSITION, Position, 1) 
      WrdStart.l = ScintillaSendMessage (#SciID,#SCI_WORDSTARTPOSITION, Position, 1) 
      
      SCTxtRng\chrg\cpMax = WrdEnd.l ;CHANGED to point to correct structure 
      SCTxtRng\chrg\cpMin = WrdStart.l ;CHANGED to point to correct structure 
      
      ScintillaSendMessage (#SciID, #SCI_SETSEL, WrdStart, WrdEnd) 
     
      ;.......................Sparkie was here ........................
      SCTxtRng\chrg\cpMin = WrdStart
      SCTxtRng\chrg\cpMax = WrdEnd 
      SCTxtRng\lpstrText  = AllocateMemory(WrdEnd - WrdStart + 1) 
      txtLen.l = ScintillaSendMessage (#SciID,#SCI_GETTEXTRANGE,0, SCTxtRng) 
      
      Debug (Str(WrdStart) + " " + Str(WrdEnd) + " " + Str(txtLen)) 
      
      clicked_text.s= PeekS(SCTxtRng\lpstrText, txtLen) ;CHANGED 
      SetGadgetText(#SrchID,clicked_text) 
      FreeMemory(SCTxtRng\lpstrText)
      ;.....................................................................
      
      ;---- #SCN_STYLENEEDED 
    Case #SCN_STYLENEEDED 
      Highlight(EditorGadget, -1, *scinotify\Position) 
  EndSelect 
  
  
  ProcedureReturn result 
  
EndProcedure 
;---- OpenWindow(0) 
OpenWindow(0, 0, 0, 600, 400, "Task List", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar) 

CreateMenu(0, WindowID(0)) 
MenuTitle("File") 
MenuItem(1, "Quit") 

CreateGadgetList(WindowID(0)) 
StringGadget(#SrchID, 5, 5, 570, 16, "Search",#PB_String_BorderLess) 
ScintillaGadget(#SciID, 5, 27, 590, 348, @ScintillaCallBack()) 
SetGadgetColor(#SrchID, #PB_Gadget_FrontColor, $C0C0C0) 
  
;---- Choose a lexer 
ScintillaSendMessage (#SciID, #SCI_SETLEXER, #SCLEX_CONTAINER, 0) 

;---- Set default font 
ScintillaSendMessage (#SciID, #SCI_STYLESETFONT, #STYLE_DEFAULT, @"Courier New") 
ScintillaSendMessage (#SciID, #SCI_STYLESETSIZE, #STYLE_DEFAULT, 8) 
ScintillaSendMessage (#SciID, #SCI_STYLECLEARALL) 

;---- Set styles for custom lexer 
ScintillaSendMessage (#SciID, #SCI_STYLESETFORE, #LexerState_Click, $EE0000) 
ScintillaSendMessage (#SciID, #SCI_STYLESETFONT, #LexerState_Click, @"Tahoma") 
ScintillaSendMessage (#SciID, #SCI_STYLESETSIZE, #LexerState_Click, 10) 
ScintillaSendMessage (#SciID, #SCI_STYLESETHOTSPOT, #LexerState_Click, #True) 


;---- Set some sample text 
text.s = "The clickable text is blue" + #CRLF$ 
text + "Click these : @clickme or @clickmeinstead" + #CRLF$ 
ScintillaSendMessage (#SciID, #SCI_SETTEXT, 0, @text) 
SetActiveGadget(#SciID) 

RemoveKeyboardShortcut(0, #PB_Shortcut_Tab) 
RemoveKeyboardShortcut(0, #PB_Shortcut_Tab | #PB_Shortcut_Shift) 
;---- Event Loop 
quit.l = #False 
Repeat 
  event.l = WaitWindowEvent() 
  GadgetID = EventGadget() 
  Select event 
    Case #PB_Event_CloseWindow 
      quit = #True 
    Case #PB_Event_Menu 
      Select EventMenu() 
        Case 1 : quit = #True 
      EndSelect 
  EndSelect 
Until quit 

; IDE Options = PureBasic 4.10 (Windows - x86) 
; CursorPosition = 239 
; FirstLine = 214 
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Nonproductive
User
User
Posts: 17
Joined: Fri Apr 25, 2003 10:43 pm

You Rock!

Post by Nonproductive »

Sparkie, if you were a tall, gorgeous, blonde woman I would kiss you.
In case you're not - THANK YOU! This has been killing me for 2 days...

Citystate and Demivec - very much appreciate your assistance as well!

Now, to make sure I understand it :)

This is my 1st time working with the Scintilla gadget as well - and I am finding it both a treat for all the built in functionality and a pain for all the new stuff I need to figure out.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Nonproductive wrote:Sparkie, if you were a tall, gorgeous, blonde woman...
I can meet 2 out 4 requirements and woman is NOT one of them. Fill the urge by kissing the next woman you see and please... DO NOT think of me while doing so. :P

Good luck with your Scintilla adventure. :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply