Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new widgets: YMenuBar, YItemSelector #36

Merged
merged 6 commits into from
Nov 25, 2020
Merged

Added new widgets: YMenuBar, YItemSelector #36

merged 6 commits into from
Nov 25, 2020

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Nov 17, 2020

This adds the new widgets that were added to libyui in recent months to the bindings:

This was requested by @anaselli so they can finally migrate from the MGAMenuBar to this new common YMenuBar.

Please notice that I don't know much about SWIG bindings; I just added lines that were similar to existing ones (YMenuButton).

Most of YMenuButton is now in a new base class YMenuWidget that is also inherited by YMenuBar, so both widgets share the parts that might be sensitive (addItem( YWidget *item_disown )).

YItemSelector is another YSelectionWidget that also heavily relies on its base class; I don't expect any trouble there.


@dmulder : I was told you are interested in this package from the SUSE side. Can you have a look at this PR?

@dmulder
Copy link
Contributor

dmulder commented Nov 18, 2020

@shundhammer looks ok to me.

@shundhammer
Copy link
Contributor Author

@dmulder : Thanks!

Copy link
Contributor

@anaselli anaselli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also add this python example under swig/python/examples

swig/yui.i Show resolved Hide resolved
swig/yui.i Show resolved Hide resolved
@mvidner
Copy link
Member

mvidner commented Nov 23, 2020

I have a build fix for the Travis failure...

@mvidner
Copy link
Member

mvidner commented Nov 23, 2020

@shundhammer please cherry pick 2abc86f

(and if you in the future make PRs from a branch in the main repo instead of from your fork, I will be able to simply add the commit instead of bothering you to do it)

Martin Vidner and others added 2 commits November 23, 2020 14:55
but keep working with 3.17 (in Leap 15.2 for example)
@mvidner
Copy link
Member

mvidner commented Nov 24, 2020

@anaselli I have added your example, but it has not worked for me until I applied the fix below. The runtime error was

self.menubar.resolveShortcutConflicts()
AttributeError: 'YMenuBar' object has no attribute 'resolveShortcutConflicts'

and swig 4.0.2 was saying at compile time

/usr/include/yui/YMenuBar.h:50: Warning 401: Base class 'YMenuWidget' undefined.
/usr/include/yui/YMenuWidget.h:39: Warning 401: 'YMenuWidget' must be defined before it is used as a base class.

I wonder if you've seen this.

Fix:

diff --git a/swig/yui.i b/swig/yui.i
index b90a336..55b3878 100644
--- a/swig/yui.i
+++ b/swig/yui.i
@@ -66,10 +66,10 @@ SWIGEXPORT void Init__yui(void) {
 #include "yui/YMacro.h"
 #include "yui/YMacroPlayer.h"
 #include "yui/YMacroRecorder.h"
+#include "yui/YMenuWidget.h"
 #include "yui/YMenuBar.h"
 #include "yui/YMenuButton.h"
 #include "yui/YMenuItem.h"
-#include "yui/YMenuWidget.h"
 #include "yui/YMultiLineEdit.h"
 #include "yui/YMultiProgressMeter.h"
 #include "yui/YMultiSelectionBox.h"
@@ -224,10 +224,10 @@ class Exception;
 %include yui/YMacro.h
 %include yui/YMacroPlayer.h
 %include yui/YMacroRecorder.h
+%include yui/YMenuWidget.h
 %include yui/YMenuBar.h
 %include yui/YMenuButton.h
 %include yui/YMenuItem.h
-%include yui/YMenuWidget.h
 %include yui/YMultiLineEdit.h
 %include yui/YMultiProgressMeter.h
 %include yui/YMultiSelectionBox.h

@anaselli
Copy link
Contributor

@mvidner yes i wrote for those missing entries in my review comments...

otherwise swig 4.0.2 says

    /usr/include/yui/YMenuBar.h:50: Warning 401: Base class 'YMenuWidget' undefined.
    /usr/include/yui/YMenuWidget.h:39: Warning 401: 'YMenuWidget' must be defined before it is used as a base class.

and then it fails at runtime

    self.menubar.resolveShortcutConflicts()
    AttributeError: 'YMenuBar' object has no attribute 'resolveShortcutConflicts'
@shundhammer shundhammer merged commit f0e730c into libyui:master Nov 25, 2020
@shundhammer shundhammer deleted the huha-menubar branch November 25, 2020 11:56
mvidner pushed a commit to mvidner/libyui-combined-alpha-2 that referenced this pull request Dec 14, 2020
…nubar

Added new widgets: YMenuBar, YItemSelector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants