This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Interface to the generic menu and toolbar


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]