Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
Add elements to UI
06-15-2013, 06:45 PM
Post: #1
Add elements to UI
Because it is so complicated to add new elements to the interface, due to 'split_list'.
Is there no a better system of doing this (in Erlang)?
Code:
export_dialog_loop({Op,Fun}=Keep, Attr) ->
    {Prefs,Buttons} = split_list(Attr, 79), %% povman: add index?? old value 78
    case Buttons of
        [true,false,false] -> % Save
            set_user_prefs(Prefs),
            {dialog,
             export_dialog_qs(Op, Attr),
             export_dialog_fun(Keep)};
        [false,true,false] -> % Load
            {dialog,
             export_dialog_qs(Op,
                              get_user_prefs(export_prefs())
                              ++[save,load,reset]),
             export_dialog_fun(Keep)};
        [false,false,true] -> % Reset
            {dialog,
             export_dialog_qs(Op,
                              export_prefs()++[save,load,reset]),
             export_dialog_fun(Keep)};
        [false,false,false] -> % Ok
            Fun(Prefs)
    end.

Or there...

Code:
%%% Increase split_list # +1 per line if add Modulator to Dialog

modulator(Minimized, Enabled, Mode, Res0, M) ->
    {Res1,Res} = split_list(Res0, 39), % org : 37
    TypeTag = {?TAG,type,M},
    {value,{TypeTag,TexType}} = lists:keysearch(TypeTag, 1, Res1),
....

Smile

The Universe is an infinite equation
Reply
06-17-2013, 07:57 PM (This post was last modified: 06-17-2013 07:57 PM by micheus.)
Post: #2
RE: Add elements to UI
povmaniac, I'm not sure I can help you with this, but have you took a look in the Ask dialogs examples (wpc_test_ask.erl) at /wings/plugin_src?
There is an sample about add components dynamically: dynamic_dialog/1
Maybe it can help you.

You also can load the module by typing at the Erlang console (after you start your Wings3d):
Code:
1>  wpc_test_ask:enable().
-----
2>  wpc_test_ask:disable().
don't forget the [dot] at the end of line.
Reply
06-17-2013, 08:51 PM
Post: #3
RE: Add elements to UI
Ok. My Erlang is not good, atm Smile
Thanks

The Universe is an infinite equation
Reply


Forum Jump:


User(s) browsing this thread: 1 Guest(s)