Matthew Gregory wrote:
>
> Hi nislim,
> Try changing this.createFileMenu() to this.createFileMenu.
> You don't want to call the function here you just want to reference it.
>
> Also instead of trying to get the document width have you tried
> something like this?
> frame.add(menuBar, {left : 0, right : 0})
>
>
> nislim wrote:
>> This is the code i use to generate a simple menu:
>>
>> CreateMenu : function()
>> {
>> if (parseInt(navigator.appVersion)>3) {
>> if (navigator.appName=="Netscape") {
>> winW = window.innerWidth;
>> }
>> if (navigator.appName.indexOf("Microsoft")!=-1) {
>> winW = document.body.offsetWidth;
>> }
>> }
>>
>> var frame = new qx.ui.container.Composite(new
>> qx.ui.layout.Grow);
>>
>> var menuBar = new qx.ui.menubar.MenuBar;
>> menuBar.setWidth(winW-2);
>> frame.add(menuBar);
>>
>> // [MenuBar]
>> menuBar.add(new qx.ui.menubar.Button("Test",
>> this.createFileMenu()));
>> //fileMenu.addListener("execute", this.createFileMenu());
>>
>>
>> return frame;
>> },
>>
>> createFileMenu: function()
>> {
>> alert("Do you see?");
>> }
>>
>> I want that the alert do you se shows when i click the button but instead
>> it
>> shows when i open the page.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
Thanks, now I can create a menu but if I want to call for example a
message(alert("You clicked me!")) but if I do that. It will pop-up when I
start the application.
--
View this message in context:
http://www.nabble.com/Menubutton-error-tp19810858p19864225.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel