Hi Another little patch, adding MiniFrame (a frame with small title bar and buttons which doesn''t appear in the desktop taskbar). Also a sample - not very interesting, happy to roll this into something else if that''s better. cheers alex _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
That code compiled nice for me on OS X and worked fine. The only problem I see is that VERSION_STRING is not defined. wxWidgets 2.6.3 swig 1.3.29 iMac Intel OS X 10.4.7 Sean On 7/24/06, Alex Fenton <alex at pressure.to> wrote:> Hi > > Another little patch, adding MiniFrame (a frame with small title bar and > buttons which doesn''t appear in the desktop taskbar). > > Also a sample - not very interesting, happy to roll this into something > else if that''s better. > > cheers > alex > > > # Copyright 2004-2005 by Kevin Smith > # released under the MIT-style wxruby2 license > > %include "../common.i" > > %module(directors="1") wxMiniFrame > > %{ > #include <wx/minifram.h> > %} > > %import "include/wxObject.h" > %import "include/wxEvtHandler.h" > %import "include/wxWindow.h" > %import "include/wxFrame.h" > > > %include "include/wxMiniFrame.h" > > require ''wx'' > > class MyFrame < Wx::Frame > def initialize(title, pos, size, style = Wx::DEFAULT_FRAME_STYLE) > super(nil, -1, title, pos, size, style) > > > menuFile = Wx::Menu.new() > helpMenu = Wx::Menu.new() > helpMenu.append(Wx::ID_ABOUT, "&About...\tF1", "Show about dialog") > menuFile.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program") > menuBar = Wx::MenuBar.new() > menuBar.append(menuFile, "&File") > menuBar.append(helpMenu, "&Help") > set_menu_bar(menuBar) > > create_status_bar(2) > set_status_text("Welcome to wxRuby!") > > evt_menu(Wx::ID_EXIT) { onQuit } > evt_menu(Wx::ID_ABOUT) { onAbout } > m = Wx::MiniFrame.new(nil, -1, ''Mini Frame'') > m.show() > > end > > def onQuit > close(Wx::TRUE) > end > > def onAbout > msg = sprintf("This is the About dialog of the miniframe sample.\n" \ > "Welcome to %s", VERSION_STRING) > > message_box(msg, "About MiniFrame", OK | ICON_INFORMATION, self) > > end > end > > class RbApp < Wx::App > def on_init > frame = MyFrame.new("Mini Frame wxRuby App", > Wx::Point.new(50, 50), > Wx::Size.new(450, 340)) > > frame.show(TRUE) > > end > end > > app = RbApp.new > app.main_loop() > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > >
Sean Long wrote:> That code compiled nice for me on OS X and worked fine. The only > problem I see is that VERSION_STRING is not defined. >Oops, thanks, revised sample attached.> wxWidgets 2.6.3 > swig 1.3.29 > iMac Intel OS X 10.4.7 >So it is possible to compile wxruby2 on 10.4 - just checking b/c there''s a bug filed against it. http://rubyforge.org/tracker/index.php?func=detail&aid=4633&group_id=35&atid=218 But it looks there like the submitter was using an old 2.5 release of wx. cheers alex> Sean > > On 7/24/06, Alex Fenton <alex at pressure.to> wrote: > >> Hi >> >> Another little patch, adding MiniFrame (a frame with small title bar and >> buttons which doesn''t appear in the desktop taskbar). >> >> Also a sample - not very interesting, happy to roll this into something >> else if that''s better. >> >> cheers >> alex >> >> >> # Copyright 2004-2005 by Kevin Smith >> # released under the MIT-style wxruby2 license >> >> %include "../common.i" >> >> %module(directors="1") wxMiniFrame >> >> %{ >> #include <wx/minifram.h> >> %} >> >> %import "include/wxObject.h" >> %import "include/wxEvtHandler.h" >> %import "include/wxWindow.h" >> %import "include/wxFrame.h" >> >> >> %include "include/wxMiniFrame.h" >> >> require ''wx'' >> >> class MyFrame < Wx::Frame >> def initialize(title, pos, size, style = Wx::DEFAULT_FRAME_STYLE) >> super(nil, -1, title, pos, size, style) >> >> >> menuFile = Wx::Menu.new() >> helpMenu = Wx::Menu.new() >> helpMenu.append(Wx::ID_ABOUT, "&About...\tF1", "Show about dialog") >> menuFile.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program") >> menuBar = Wx::MenuBar.new() >> menuBar.append(menuFile, "&File") >> menuBar.append(helpMenu, "&Help") >> set_menu_bar(menuBar) >> >> create_status_bar(2) >> set_status_text("Welcome to wxRuby!") >> >> evt_menu(Wx::ID_EXIT) { onQuit } >> evt_menu(Wx::ID_ABOUT) { onAbout } >> m = Wx::MiniFrame.new(nil, -1, ''Mini Frame'') >> m.show() >> >> end >> >> def onQuit >> close(Wx::TRUE) >> end >> >> def onAbout >> msg = sprintf("This is the About dialog of the miniframe sample.\n" \ >> "Welcome to %s", VERSION_STRING) >> >> message_box(msg, "About MiniFrame", OK | ICON_INFORMATION, self) >> >> end >> end >> >> class RbApp < Wx::App >> def on_init >> frame = MyFrame.new("Mini Frame wxRuby App", >> Wx::Point.new(50, 50), >> Wx::Size.new(450, 340)) >> >> frame.show(TRUE) >> >> end >> end >> >> app = RbApp.new >> app.main_loop() >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: miniframe.rb Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060725/cf9e23ac/attachment.pl
> So it is possible to compile wxruby2 on 10.4 - just checking b/c there''s > a bug filed against it. > > http://rubyforge.org/tracker/index.php?func=detail&aid=4633&group_id=35&atid=218 > > But it looks there like the submitter was using an old 2.5 release of wx.I have had no troubles compiling on 10.4, with ppc or intel. Well I did have a problem once when I forgot to update to 2.6.3 and tried compiling with 2.6.2. I think the version of wx used and the version of Swig are the two biggest potential problem areas. Sean
On Tue, 2006-07-25 at 07:43 +0100, Alex Fenton wrote:> >> Another little patch, adding MiniFrame (a frame with small title bar and > >> buttons which doesn''t appear in the desktop taskbar). > >> > >> Also a sample - not very interesting, happy to roll this into something > >> else if that''s better. > > > Oops, thanks, revised sample attached.I applied this, after changing the sample About Box to use Wx::message_box instead of just message_box, because the latter crashed for me. I''m not really happy with the sample. First, the miniframe comes up behind the main window for me, so I didn''t even notice it at first. Second, and more importantly, there is no clean way to exit. Choosing File/Exit aborts with an error, and hitting the X close box on the main frame leaves the miniframe active, with no way to close it. I put the sample in etc/ and would really appreciate if you could submit a patch to improve it. Thanks, Kevin
Hi> I''m not really happy with the sample. First, the miniframe comes up > behind the main window for me, so I didn''t even notice it at first. >I''ve modified the sample so it should raise the MiniFrame above the main frame, and on OS X (for real) and Windows (according to the docs) keep it above there - I think this is a common option.> Second, and more importantly, there is no clean way to exit. Choosing > File/Exit aborts with an error, and hitting the X close box on the main > frame leaves the miniframe active, with no way to close it. >OK, have fixed the on_quit method. On OS X the miniframe is automatically closed when the main app window is closed, but I''ve added an explicit call to close the miniframe call in the method. Hopefully this should fix things on other platforms. cheers alex -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: miniframe.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060816/de187af6/attachment.pl
On Wed, 2006-08-16 at 01:29 +0100, Alex Fenton wrote:> I''ve modified the sample so it should raise the MiniFrame above the main > frame, and on OS X (for real) and Windows (according to the docs) keep > it above there - I think this is a common option.Works great on Linux.> OK, have fixed the on_quit method. On OS X the miniframe is > automatically closed when the main app window is closed, but I''ve added > an explicit call to close the miniframe call in the method. Hopefully > this should fix things on other platforms.Perfect. Thanks! Kevin