This seems to be a bug in the older version (v10) of the toolkit...  I tried 
your example program against the more recent version of the toolkit code (in 
cvs/v11 distribution) and it appears to be cured there.

Slightly modified test prog (to link against newer toolkit) is attached.

Hope this helps.
####################################################

$include "guih.icn"
import gui

#
# Simple example of a TabSet
#
class TabDemo : Dialog(quit_button,
  list_1, list_2, num )
  
   #
   # Quit on button press.
   #
   method handle_quit_button(ev)
         dispose()
   end

  method tick()
    local l

    num +:= 1
    s := list_1.get_contents()

    put(s, "tick " || num)
    list_1.set_contents(s, *s)

    list_1.goto_pos(*s)

  end

initially
   local tab_set, tab_item_1, tab_item_2, 
         tab_item_3, label_3
   self.Dialog.initially()
   attrib("size=355,295", "font=sans",
               "bg=light gray", "resize=on")
   #
   # Create the TabSet
   #
   tab_set := TabSet("pos=50%,47", "size=200,150", "align=c,t")

   #
   # First pane
   #
   tab_item_1 := TabItem("label=Pane 1")

   #
   # Create a TextList, with some arbitrary content.
   #
   list_1 := TextList("pos=10,10", "size=80%,80%")
   list_1.set_contents([])
   tab_item_1.add(list_1)
   tab_set.add(tab_item_1)


   #
   # Second pane
   #
   tab_item_2 := TabItem("label=Pane 2")

   #
   # Create a TextList, with some arbitrary content.
   #
   list_2 := TextList("pos=10,10", "size=80%,80%")
   list_2.set_contents([])

   tab_item_2.add(list_2)
   tab_set.add(tab_item_2)


   #
   # Third pane
   #
   tab_item_3 := TabItem("label=Pane 3")
   label_3 := Label("pos=50%,50%", "align=c,c", "label=Label 3")
   tab_item_3.add(label_3)
   tab_set.add(tab_item_3)
   tab_set.set_which_one(tab_item_1)
   add(tab_set)
   #
   # Add a quit button
   #
   quit_button := TextButton("pos=50%,234", "align=c,t",
                             "label=Quit")
   quit_button.connect(self, "handle_quit_button", ACTION_EVENT)
   add(quit_button)

   num := 1

   set_ticker(1000)

   show_modal()
end

procedure main()
   TabDemo()
end

Reply via email to