TOPIC: How can I make a PersistentWindow with a Control ?
#1693
How can I make a PersistentWindow with a Control ? 8 Months, 3 Weeks ago
I make a simple Control like this:


Code:


MainFormControl
Controller
{
Title: 'DAD'
Xmin:250
Ymin:250
Xstretch: true
Ystretch:true
Controls: (Vert
(Tabs
(Tab: 'TAB1', Vert
Skip
(Button 'B1', command: 'tab1b1',  xmin: 200)
Skip
(Button 'B2', command: 'tab1b2', xmin: 200)
Skip
(Button 'B3', command: 'tab1b3', xmin: 200)
)
(Tab: 'TAB2', Vert
Skip
(Button 'B1', command: 'tab2b1', xmin: 200)
Skip
(Button 'B2', command: 'tab2b2', xmin: 200)
Skip
(Button 'B3', command: 'tab2b3', xmin: 200)
)
(Tab: 'TAB3', Vert (Button))
(Tab: 'TAB4', Vert
Skip
(Button 'B1', command: 'tab4b1', xmin: 200)
Skip
(Button 'B2', command: 'tab4b2', xmin: 200)
Skip
(Button 'B3', command: 'tab4b3', xmin: 200)
)
)
(Statusbar)
)

On_tab1b1()
{
Alert('tab1b1')
}
On_tab1b2()
{
Alert('tab1b2')
}
On_tab1b3()
{
Alert('tab1b3')
}

On_tab2b1()
{
Alert('tab2b1')
}
On_tab2b2()
{
Alert('tab2b2')
}
On_tab2b3()
{
Alert('tab2b3')
}

On_tab4b1()
{
Alert('tab4b1')
}
On_tab4b2()
{
Alert('tab4b2')
}
On_tab4b3()
{
Alert('tab4b3')
}
}



But when trying to call PersistentWindow like this:

PersistentWindow(#(MainForm, "My Application") newset: "myset")

I get the debugger saying: can't find MainFormControl
 
 
Last Edit: 2009/12/02 01:45 By mingodad.
 
#1696
Re:How can I make a PersistentWindow with a Control ? 8 Months, 3 Weeks ago
You should not need anything special. For example:

PersistentWindow(#(Static hello))

You can define GetState and SetState but they should be optional (there are defaults in Control).

Did you call your control MainFormControl (with the "Control" suffix)

Does it work with just Window?

NOTE: If you want Suneido to exit when you close your window you should pass Master?: true
 
 
andrew