Languages

Widget

[Genie] Test Mx Widget

0
Your rating: None
[indent=4]
 
uses
    Mx
 
progressbar : ProgressBar
slider : Slider
 
def static main_content () : Clutter.Actor
    var table = new Table ()
    table.column_spacing = 24
    table.row_spacing = 24
 
    var mylabel = new Label.with_text ("Hello World")
    mylabel.tooltip_text = "I'm a label"
    table.add_actor_with_properties (mylabel, 0, 0, "y-fill", false)
 
    var combo = new ComboBox ()
    combo.active_text = "Hello World"
    combo.append_text ("Hello")
    combo.append_text ("Word")
    table.add_actor_with_properties (combo, 0, 1, "y-fill", false)
 
    progressb

[Genie] Changing the background color of a Widget

0
Your rating: None
[indent=2]
uses Gtk, Gdk
 
def set_color (out w : Gtk.Widget)
  c : Gdk.Color
  // background now black instead of gray
  Gdk.Color.parse("black", out c)    
  w.modify_bg(StateType.NORMAL, c)
  // red when hover over
  Gdk.Color.parse("red", out c)    
  w.modify_bg(StateType.PRELIGHT, c)
  // blue when focused
  Gdk.Color.parse("blue", out c)    
  w.modify_bg(StateType.ACTIVE, c)
  // cyan when selected
  Gdk.Color.parse("cyan", out c)    
  w.modify_bg(StateType.SELECTED, c)
 
Syndicate content