mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Problem in replacing icons with QPushButton widgets


Chronological Thread 
  • From: Gubinelli Massimiliano <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Problem in replacing icons with QPushButton widgets
  • Date: Wed, 14 Oct 2009 12:54:43 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=KfT5ZiCN/FhkrErZP7Hwo/c9ezDycZqTd17/SlVmi4Lp1Ewa7CJct+yq3EJgVskZ7C IaTIeMnIhmAU7+/l9NHRnyjLFbND3xUmlIt/2NW/64u0bFJ1XSJlb6sO9EcXmsPjRkrC n+UBdmb3Jy/B3vQKyU4FoxQyMUM3yt+2QTXxM=

Hi,

On 14 oct. 09, at 12:41, siva prasad wrote:

Hi all....
Currently in scheme, if we want to place any icon in toolbar we are using like this..::

(balloon (icon ".....") "hello..")

we are using this in "main-menu.scm" . In similar way as Icons, I want to replace them with QPushButtons.
I want to replace Icons with QPushButton widgets (push buttons)...I want to use same "balloon" function in scheme.
But It should provide pushbuttons in place of Icons.

Where I have to change the code...and...what function I should Use??


1. To introduce new scheme primitives you should look at Guile/Glue/ build-glue-basic.scm where you can define new widget creation functions like already done:

;; widgets
(widget-hmenu horizontal_menu (widget array_widget))
(widget-vmenu vertical_menu (widget array_widget))
(widget-tmenu tile_menu (widget array_widget int))
(widget-separator menu_separator (widget bool))
(widget-menu-group menu_group (widget string string))
(widget-pulldown-button pulldown_button (widget widget promise_widget))
(widget-pullright-button pullright_button (widget widget promise_widget))
(widget-menu-button menu_button (widget widget command string string bool))
(widget-balloon balloon_widget (widget widget widget))
(widget-empty empty_widget (widget))
(widget-text text_widget (widget string int bool string))
(widget-xpm xpm_widget (widget url))
(widget-box box_widget (widget scheme_tree string int bool bool))
(object->promise-widget as_promise_widget (promise_widget object))


2. define a new function pushbutton_widget and provide implementation like those in qt_*.cpp for the standard widget functions like
balloon_widget, text_widget, xpm_widget, etc...

3. reimplement the method qt_widget::as_qaction to returns a QWidgetAction which refers to you QPushButton.

HTH,
Best
Massimiliano Gubinelli





Archive powered by MHonArc 2.6.19.

Top of page