* Interface to the generic menu and toolbar
@ 2001-01-25 11:23 Fernando Nasser
2001-02-01 13:08 ` Fernando Nasser
2001-02-01 15:04 ` Fernando Nasser
0 siblings, 2 replies; 3+ messages in thread
From: Fernando Nasser @ 2001-01-25 11:23 UTC (permalink / raw)
To: Insight List, Jim Ingham, Keith Seitz
The existent interface to the menubar (which uses Tk menu) is
currently:
# GDBMenuBar
public method menubar_show {}
public method set_class_state {enable_list}
method menubar_new_menu {name label underline}
method menubar_menu_exists {name}
method menubar_clear_menu {name}
method menubar_add_menu_separator {}
method menubar_add_menu_command {class label command args}
method menubar_change_menu_state {menu state}
method menubar_set_current_menu {menup}
Note that the code currently uses positional parameters.
I would like to make this more like iwidgets (or even Tk), with
commands and arguments.
For instance:
$Menu add menubutton <name> -label <label> -underline <pos>
instead of
$Menu menubar_new_menu <name> <label> <pos>
I don't mean we should have all the operations the iwidget menubar has
or that
we do not add some operations we find useful. I am just talking about
the style.
We do have some extra functionality anyway (like the classes that can be
enabled/disabled).
We could keep the names of the options that are equivalent the same
though.
The toolbar (which uses libgui TOOLBAR) uses:
# GDBToolBar
public method toolbar_show {}
public method set_class_state {enable_list}
method toolbar_create_button {name class command balloon args}
method toolbar_add_button {name class command balloon args}
method toolbar_add_button_separator {}
method toolbar_button_right_justify {}
method toolbar_add_label {name text balloon args}
method toolbar_insert_button {name before}
method toolbar_remove_button {name}
method toolbar_configure_button {button args}
method toolbar_bind_button {button key cmd}
method toolbar_set_button_balloon {button text}
method toolbar_swap_button_lists {in_list out_list}
Similarly:
$Tool add button <name> -class <class> -command <command> -ballon <help
text>
In this case I would like to make a semantic change though. Currently,
buttons added after toolbar_button_right_justify are aligned to the
right.
Instead of imposing the creation order (having some sort of context), I
think
it would be nice to have an -align option and let the widget take care
of
organizing what goes left or right. In this case we get rid of
toolbar_button_right_justify. BTW, the iwidgets toolbar does not have
this
left or right capability -- we can be this fancy because the libgui
TOOLBAR
uses grid internally.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interface to the generic menu and toolbar
2001-01-25 11:23 Interface to the generic menu and toolbar Fernando Nasser
@ 2001-02-01 13:08 ` Fernando Nasser
2001-02-01 15:04 ` Fernando Nasser
1 sibling, 0 replies; 3+ messages in thread
From: Fernando Nasser @ 2001-02-01 13:08 UTC (permalink / raw)
To: Insight List, Jim Ingham, Keith Seitz
Nobody objected (what is reasonable -- the Tk and iwidgets style cannot
be that bad) so I went ahead and did it. I will soon have a description
as part of the new Plugin facility (I am still writting it).
* library/gdbmenubar.itcl (constructor): Remove unused code.
(add): New method. Emulate the style of the menubar iwidget commands.
(menubar_show): Old name.
(show): New name.
(menubar_menu_exists): Old name.
(exists): New name.
(menubar_clear_menu): Old name.
(clear): New name.
(menubar_delete_menu): Old name.
(delete): New name.
(menubar_new_menu): Make private. Does not return anything.
(menubar_add_menu_command): Make private.
(menubar_add_menu_separator): Ditto.
(menubar_change_menu_state): Ditto.
* library/srcbar.itcl: Adjust to the above syntax.
* library/plugins/plugins.tcl: Ditto.
* library/plugins/rhabout/rhabout.itcl: Ditto.
Fernando Nasser wrote:
>
> The existent interface to the menubar (which uses Tk menu) is
> currently:
>
> # GDBMenuBar
> public method menubar_show {}
> public method set_class_state {enable_list}
> method menubar_new_menu {name label underline}
> method menubar_menu_exists {name}
> method menubar_clear_menu {name}
> method menubar_add_menu_separator {}
> method menubar_add_menu_command {class label command args}
> method menubar_change_menu_state {menu state}
> method menubar_set_current_menu {menup}
>
> Note that the code currently uses positional parameters.
>
> I would like to make this more like iwidgets (or even Tk), with
> commands and arguments.
>
> For instance:
>
> $Menu add menubutton <name> -label <label> -underline <pos>
>
> instead of
>
> $Menu menubar_new_menu <name> <label> <pos>
>
> I don't mean we should have all the operations the iwidget menubar has
> or that
> we do not add some operations we find useful. I am just talking about
> the style.
> We do have some extra functionality anyway (like the classes that can be
> enabled/disabled).
> We could keep the names of the options that are equivalent the same
> though.
>
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interface to the generic menu and toolbar
2001-01-25 11:23 Interface to the generic menu and toolbar Fernando Nasser
2001-02-01 13:08 ` Fernando Nasser
@ 2001-02-01 15:04 ` Fernando Nasser
1 sibling, 0 replies; 3+ messages in thread
From: Fernando Nasser @ 2001-02-01 15:04 UTC (permalink / raw)
To: Insight List, Jim Ingham, Keith Seitz
I partially did this part. I still have to look at the arguments
though.
But it already has an itcl'sh flavor.
2001-02-01 Fernando Nasser <fnasser@redhat.com>
* library/gdbtoolbar.itcl (add): New method. Emulate the style of the
toolbar iwidget commands.
(toolbar_show): Old name.
(show): New name.
(toolbar_create_button): Old name.
(create): New name.
(toolbar_configure_button): Old name.
(itemconfigure): New name.
(toolbar_bind_button): Old name.
(itembind): New name.
(toolbar_set_button_balloon): Old name.
(itemballoon): New name.
(toolbar_add_button): Make private.
(toolbar_add_label): Ditto.
(toolbar_add_button_separator): Ditto.
(toolbar_remove_button): Ditto.
(tollbar_insert_button): Ditto.
* library/srcbar.itcl: Adjust to the above syntax.
* library/plugins/rhabout/rhabout.itcl: Ditto.
Fernando Nasser wrote:
>
> The toolbar (which uses libgui TOOLBAR) uses:
>
> # GDBToolBar
> public method toolbar_show {}
> public method set_class_state {enable_list}
> method toolbar_create_button {name class command balloon args}
> method toolbar_add_button {name class command balloon args}
> method toolbar_add_button_separator {}
> method toolbar_button_right_justify {}
> method toolbar_add_label {name text balloon args}
> method toolbar_insert_button {name before}
> method toolbar_remove_button {name}
> method toolbar_configure_button {button args}
> method toolbar_bind_button {button key cmd}
> method toolbar_set_button_balloon {button text}
> method toolbar_swap_button_lists {in_list out_list}
>
> Similarly:
>
> $Tool add button <name> -class <class> -command <command> -ballon <help
> text>
>
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-02-01 15:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-25 11:23 Interface to the generic menu and toolbar Fernando Nasser
2001-02-01 13:08 ` Fernando Nasser
2001-02-01 15:04 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).