At the bottom you will find code that will change a button color when pressed. There is probably a better way to do it but I don't have the time to figure it out.

Thanks,
  Nolan Clayton

On Wed, 2 Feb 2005, Wendell Turner wrote:

How can I change the color of a button in the v11 graphics?  The
v10 way was

 b := TextButton("label=Button", "pos=50%,66%", "align=c,c")

then later

 b.attrib("bg=blue", "label=connected" )
 b.invalidate()

but that doesn't seem to work now.  The label changes, but not
the color.  Any suggestions?

Wendell






import gui $include "guih.icn"

class Untitled : Dialog(text_button_1)
   method component_setup()
      self.setup()
   end

   method end_dialog()
   end

   method init_dialog()
   end

   method on_text_button_1(ev)
      text_button_1.set_attribs("bg=blue")
      text_button_1.init()
   end

   method setup()

      self.set_attribs("size=644,399")
      text_button_1 := TextButton()
      text_button_1.set_pos("212", "125")
      text_button_1.set_attribs("bg=green")
      text_button_1.connect(self, "on_text_button_1", ACTION_EVENT)
      text_button_1.clear_toggles()
      text_button_1.set_label("Button")
      text_button_1.set_internal_alignment("c")
      self.add(text_button_1)
   end

   initially
      self.Dialog.initially()
end

procedure main()
   local d
   d := Untitled()
   d.show_modal()
end



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to