Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] Searchfield not showing up in toolbar (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] [ANN] 13.1pr12
Next thread: [MBS] NSSearchField Issue


Re: [MBS] PortAudio bug?   -   Garth Hjelte
  [MBS] Searchfield not showing up in toolbar   -   Beatrix Willius
   Re: [MBS] Searchfield not showing up in toolbar   -   Beatrix Willius
   Re: [MBS] Searchfield not showing up in toolbar   -   Beatrix Willius
   Re: [MBS] Searchfield not showing up in toolbar   -   Christian Schmitz

[MBS] Searchfield not showing up in toolbar
Date: 07.04.13 17:11 (Sun, 7 Apr 2013 18:11:03 +0200)
From: Beatrix Willius
Almost there: does anyone have an idea why a searchfield wouldn't show up in the toolbar? The code is pretty much standard:

SearchField = New NSToolbarSearchField
SearchFieldItem = New NSToolbarItemMBS("Search")
SearchFieldItem.paletteLabel = "Search"
SearchFieldItem.view = SearchField

dim theToolbar as NSToolbarMBS = self.NSToolbarMBS
dim items() as NSToolbarItemMBS = theToolbar.items

for each currentItem as NSToolbarItemMBS in items
if currentItem.label = "Search" then

currentItem.view = SearchField
currentItem.maxSize = NSMakeSizeMBS(300, MainToolbarNSSearchFieldHeight)
currentItem.minSize = NSMakeSizeMBS(150, MainToolbarNSSearchFieldHeight)

end if
next

I can see with a breakpoint that the searchfield is added. Everything is not nil. The toolbar has the search toolbutton. But there is nothing to see.

This window has it all: windowsplitters, pagepanels, containers, containers in containers. This is THE most complicated part of my application.

When trying to make an example I can see a timing issue. The window uses super.constructor, which then calls the line

dim theToolbar as NSToolbarMBS = self.NSToolbarMBS

at a point when the toolbar seems to be nil.


Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Searchfield not showing up in toolbar
Date: 08.04.13 06:41 (Mon, 8 Apr 2013 07:41:09 +0200)
From: Beatrix Willius
And after opening a database the thing is gone again.

I give up. This is too annoying.

On 08.04.2013, at 06:58, Beatrix Willius <<email address removed>> wrote:

> Brute force did it: I simply made a method for the creation of the search field and call it after showing the window. So having a constructor and a subclassed window aren't a good idea for the §$%& search field.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Searchfield not showing up in toolbar
Date: 08.04.13 05:58 (Mon, 8 Apr 2013 06:58:35 +0200)
From: Beatrix Willius
Hi Christian,

On 07.04.2013, at 20:13, Christian Schmitz <<email address removed>> wrote:

> How about passing a size for this search field?

This is done in the constructor for the SearchField

Super.Constructor(0, 0, 300, MainToolbarNSSearchFieldHeight)

> In the constructor the controls are not yet created. In the open event of the window they should be ready.

Hmm…. yes, this makes sense.

Brute force did it: I simply made a method for the creation of the search field and call it after showing the window. So having a constructor and a subclassed window aren't a good idea for the §$%& search field.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Searchfield not showing up in toolbar
Date: 07.04.13 19:13 (Sun, 7 Apr 2013 20:13:28 +0200)
From: Christian Schmitz

Am 07.04.2013 um 18:11 schrieb Beatrix Willius <<email address removed>>:

> Almost there: does anyone have an idea why a searchfield wouldn't show up in the toolbar? The code is pretty much standard:
>
> SearchField = New NSToolbarSearchField

How about passing a size for this search field?

> When trying to make an example I can see a timing issue. The window uses super.constructor, which then calls the line
>
> dim theToolbar as NSToolbarMBS = self.NSToolbarMBS
>
> at a point when the toolbar seems to be nil.

In the constructor the controls are not yet created. In the open event of the window they should be ready.

Greetings
Christian