|
From: | Gubinelli Massimiliano |
Subject: | Re: [Texmacs-dev] problem in developing my own tool bar in Texmacs |
Date: | Fri, 9 Oct 2009 10:58:31 +0200 |
Hi, On 6 oct. 09, at 08:15, siva prasad wrote: hello all, I already tried to answer your question some days ago. I doubt somebody else will do it so if you didn't undestand my answer please tell me (or ask a more precise question) and I will try to explain you better the structure of the Qt port. For reference I copy below my previous answer. regards, Massimiliano Gubinelli ----- Hi, the abstract gui interface between backends and TeXmacs is described (in part) in src/src/Graphics/Gui/widget.hpp, in particular the following functions manage the creation of menus widget horizontal_menu (array<widget> a); widget vertical_menu (array<widget> a); widget tile_menu (array<widget> a, int cols); widget menu_separator (bool vertical); widget menu_group (string name, string lan= ""); widget pulldown_button (widget w, promise<widget> pw); widget pullright_button (widget w, promise<widget> pw); widget menu_button (widget w, command cmd, string pre, string ks, bool ok); widget balloon_widget (widget w, widget help); widget text_widget (string s, color col, bool tsp= true, string lan=""); widget xpm_widget (url file_name); The Qt-related code is in the directory src/src/Plugins/Qt/ in particular the menu widget interface between TeXmacs and Qt is contained in "qt_menu.{h,c}pp". The toolbars are constructed via scheme code which calls into functions of the abstract interface above returning a widget object representing the menu which is then passed to the widget object associated to the TeXmacs window to be installed as a Qt Toolbar in the QMainWindow object, see the method "qt_tm_widget_rep::write" in "qt_widget.cpp", in particular the handling of the SLOT_*_ICONS messages which install the three different kinds of toolbars. They are called very often since toolbar can change when moving cursor. Part of the scheme code is in src/TeXmacs/progs/texmacs/main-menu.scm HTH, Massimiliano |
[Prev in Thread] | Current Thread | [Next in Thread] |