Gadget Item Row Text

Just starting out? Need help? Post your questions and find answers here.
benco5000
User
User
Posts: 13
Joined: Mon Mar 01, 2010 8:56 pm

Gadget Item Row Text

Post by benco5000 »

I have this code snippet. But I must be trying to set the text in the rows incorrectly.
Any suggestions?
tia

Code: Select all

  ListIconGadget(1, 10, 10, 380, 100, "", 80, #PB_ListIcon_GridLines)
  For a = 0 To 11
    AddGadgetColumn(1, a, "Column " + Str(a), 80)       ;; Add Columns
    SetGadgetItemText(1, -1, "T" + Str(a), a)               ;; set header text
    SetGadgetItemText(1, 0, "T" + Str(a), a)                ;; how do I set row text??
    ;;SetGadgetItemText(1, 1, "T" + Str(a), a)             ;; tried this too
  Next
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Gadget Item Row Text

Post by c4s »

Take a look at the helpfile:

Code: Select all

If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
   AddGadgetColumn(0, 1, "Address", 250)
   AddGadgetItem(0, -1, "Harry Rannit"+#LF$+"12 Parliament Way, Battle Street, By the Bay")
   AddGadgetItem(0, -1, "Ginger Brokeit"+#LF$+"130 PureBasic Road, BigTown, CodeCity")
   Repeat
     Event = WaitWindowEvent()
   Until Event = #PB_Event_CloseWindow
 EndIf
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Gadget Item Row Text

Post by jamirokwai »

benco5000 wrote:I have this code snippet. But I must be trying to set the text in the rows incorrectly.
Any suggestions?
tia

Code: Select all

  ListIconGadget(1, 10, 10, 380, 100, "", 80, #PB_ListIcon_GridLines)
  For a = 0 To 11
    AddGadgetColumn(1, a, "Column " + Str(a), 80)       ;; Add Columns
    SetGadgetItemText(1, -1, "T" + Str(a), a)               ;; set header text
    SetGadgetItemText(1, 0, "T" + Str(a), a)                ;; how do I set row text??
    ;;SetGadgetItemText(1, 1, "T" + Str(a), a)             ;; tried this too
  Next
If I get the problem right... You need to use AddGadgetItem() to set the cells. Try

Code: Select all

  ListIconGadget(1, 10, 10, 380, 100, "", 80, #PB_ListIcon_GridLines)
  For a = 0 To 11
    AddGadgetColumn(1, a, "Column " + Str(a), 80)       ;; Add Columns
    SetGadgetItemText(1, -1, "T" + Str(a), a)               ;; set header text
    AddGadgetItem(1, 0, "T" + Str(a))                ;; how do I set row text??
    ;;SetGadgetItemText(1, 1, "T" + Str(a), a)             ;; tried this too
  Next
Regards,
JamiroKwai
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Gadget Item Row Text

Post by jamirokwai »

c4s wrote:Take a look at the helpfile:

Code: Select all

If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
   AddGadgetColumn(0, 1, "Address", 250)
   AddGadgetItem(0, -1, "Harry Rannit"+#LF$+"12 Parliament Way, Battle Street, By the Bay")
   AddGadgetItem(0, -1, "Ginger Brokeit"+#LF$+"130 PureBasic Road, BigTown, CodeCity")
   Repeat
     Event = WaitWindowEvent()
   Until Event = #PB_Event_CloseWindow
 EndIf
You were faster, c4s... :-)
Regards,
JamiroKwai
Post Reply