[Done] StringGadget allows multiple lines

Post bugreports for the Mac OSX version here
wombats
Enthusiast
Enthusiast
Posts: 596
Joined: Thu Dec 29, 2011 5:03 pm

[Done] StringGadget allows multiple lines

Post by wombats »

The StringGadget allows multiple lines when setting the text programatically or pasting it in.

Code: Select all

If OpenWindow(0, 0, 0, 322, 205, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 8,  10, 306, 25, "Line 1" + Chr(10) + "Line 2" + Chr(10) + "Line 3")
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Using the following fixes the issue, but it doesn't update until the StringGadget is clicked.

Code: Select all

cell = CocoaMessage(0, GadgetID(0), "cell")
CocoaMessage(0, cell, "setUsesSingleLineMode:", #YES)
Fred
Administrator
Administrator
Posts: 14206
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: StringGadget allows multiple lines

Post by Fred »

I added the flag, but the gadget doesn't behave very well if you try to delete text (spawn again on multiple lines). You shouldn't use multiline in a string gadget IMHO.
wombats
Enthusiast
Enthusiast
Posts: 596
Joined: Thu Dec 29, 2011 5:03 pm

Re: [Done] StringGadget allows multiple lines

Post by wombats »

I agree about not using multiline text in a StringGadget. Without the flag, the user can paste multiline text in, so I believe that will solve the problem. Thanks.
Post Reply