News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
FLU - FLTK Utility Widgets
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: FLU - FLTK UTILITY WIDGETS

Flu_Choice_Group:

Code:
page={}
w=fltk:Fl_Window(400,300,"Flu_Choice_Group")
g=fltk:Fl_Wizard(10,30,380,240)
g:box(fltk.FL_EMBOSSED_FRAME)
page[1]=fltk:Fl_Group(10,30,380,240)
fltk:Fl_Button(40,80,180,30,"button")
fltk:Fl_End() --1
page[2]=fltk:Fl_Group(10,30,380,240)
fltk:Fl_Button(40,80,180,30,"button")
fltk:Fl_Button(40,115,180,30,"button")
fltk:Fl_End() --2
page[3]=fltk:Fl_Group(10,30,380,240)
fltk:Fl_Button(40,80,180,30,"button")
fltk:Fl_Button(40,115,180,30,"button")
fltk:Fl_Button(40,150,180,30,"button")
fltk:Fl_End() --3
fltk:Fl_End() --main
c=fltk:Fl_Choice(20,15,180,30)
c:callback(function() g:value(page[c:value()]) end)

c:add("Choice_Group")
c:add("first tab")
c:add("second tab")
c:add("third tab")
c:value(0)
w:show()
Fl:run()

with a function:

Code:
function flu_choice_group(x,y,w,h,tabs,table,label)
local g=fltk:Fl_Wizard(x,y,w,h,label)
g:box(fltk.FL_EMBOSSED_FRAME)
fltk:Fl_End()
c=fltk:Fl_Choice(20,15,180,30)
c:callback(function() g:value(table[c:value()]) end)
if not tabs then local tabs=0 end
for i=0,tabs do
  table[i]=fltk:Fl_Group(x,y,w,h)
  fltk:Fl_End()
  g:add(table[i])
  c:add("tab "..i)
end
c:value(0)
end

page={}
w=fltk:Fl_Window(400,300,"Choice_Group Test")

g=flu_choice_group(10,30,380,240,3,page)

a1=fltk:Fl_Button(40,80,180,30,"button")
page[0]:add(a1)
b1=fltk:Fl_Button(40,80,180,30,"button")
b2=fltk:Fl_Button(40,115,180,30,"button")
page[1]:add(b1)
page[1]:add(b2)
c1=fltk:Fl_Button(40,80,180,30,"button")
c2=fltk:Fl_Button(40,115,180,30,"button")
c3=fltk:Fl_Button(40,150,180,30,"button")
page[2]:add(c1)
page[2]:add(c2)
page[2]:add(c3)

w:show()
Fl:run()

This post was last modified: 02-09-2008 12:30 PM by mikshaw.

02-09-2008 07:46 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
FLU - FLTK Utility Widgets - iGame3D - 02-08-2008, 05:48 PM
RE: FLU - FLTK UTILITY WIDGETS - JohnMurga - 02-08-2008, 07:28 PM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 01:24 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 02:43 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 03:26 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008 07:46 AM
RE: FLU - FLTK UTILITY WIDGETS - iGame3D - 02-11-2008, 07:13 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: