Re: Tab Widgets changes at runtime? [message #45835] |
Wed, 12 October 2005 03:26 |
Gianluca Li Causi
Messages: 21 Registered: August 2005
|
Junior Member |
|
|
Ops!
It was so simple... but I've not thought about!
...that because of using GUI builder.
Thanks a lot Doug.
Gianluca
Doug wrote:
> Gianluca,
>
> You should be able to add tabs by creating new bases with the tab widget as
> their parent. Delete tabs by applying widget_control's "destroy" keyword to
> a specific child base of the tab.
>
> Here's some sample code:
>
> pro delete_tab_event, e
> widget_control, e.id, get_uvalue = tabBase
> widget_control, tabBase, /destroy
> end
>
> pro add_tab_event, e
>
> widget_control, e.id, get_uvalue = tabControl
>
> newTab = widget_base( tabControl, title = 'Some Title' )
> deleteButton = widget_button( newTab, $
> value = 'Delete Me', $
> uvalue = newTab, $
> event_pro = 'delete_tab_event' )
>
> end
>
> pro adding_tabs
>
> topBase = widget_base( /column )
>
> tabControl = widget_tab( topBase, xsize = 300 )
>
> addTabButton = widget_button( topBase, $
> value = 'Add New Tab', uvalue = tabControl, $
> event_pro = 'add_tab_event' )
>
> widget_control, topBase, /realize
> xmanager, 'adding_tabs', topBase
>
> end
>
> Hope this helps.
>
> Doug
>
> "Gianluca Li Causi" <licausi@mporzio.astro.it> wrote in message
> news:1129040656.595058.149910@g14g2000cwa.googlegroups.com.. .
>> Hi all,
>>
>> I've the following problem: I have a nice tab widget with N tabs and I
>> want to add new tabs or delete some of them on the basis of some user's
>> choice.
>>
>> I've noticed that Widget_Control and Widget_Info cannot control
>> adding/deleting tabs, so is there a way to do this?
>>
>> Thanks a lot!
>> Gianluca
>>
|
|
|
Re: Tab Widgets changes at runtime? [message #45845 is a reply to message #45835] |
Tue, 11 October 2005 11:13  |
Doug
Messages: 6 Registered: October 2005
|
Junior Member |
|
|
Gianluca,
You should be able to add tabs by creating new bases with the tab widget as
their parent. Delete tabs by applying widget_control's "destroy" keyword to
a specific child base of the tab.
Here's some sample code:
pro delete_tab_event, e
widget_control, e.id, get_uvalue = tabBase
widget_control, tabBase, /destroy
end
pro add_tab_event, e
widget_control, e.id, get_uvalue = tabControl
newTab = widget_base( tabControl, title = 'Some Title' )
deleteButton = widget_button( newTab, $
value = 'Delete Me', $
uvalue = newTab, $
event_pro = 'delete_tab_event' )
end
pro adding_tabs
topBase = widget_base( /column )
tabControl = widget_tab( topBase, xsize = 300 )
addTabButton = widget_button( topBase, $
value = 'Add New Tab', uvalue = tabControl, $
event_pro = 'add_tab_event' )
widget_control, topBase, /realize
xmanager, 'adding_tabs', topBase
end
Hope this helps.
Doug
"Gianluca Li Causi" <licausi@mporzio.astro.it> wrote in message
news:1129040656.595058.149910@g14g2000cwa.googlegroups.com.. .
> Hi all,
>
> I've the following problem: I have a nice tab widget with N tabs and I
> want to add new tabs or delete some of them on the basis of some user's
> choice.
>
> I've noticed that Widget_Control and Widget_Info cannot control
> adding/deleting tabs, so is there a way to do this?
>
> Thanks a lot!
> Gianluca
>
|
|
|