Hi All! For future reference, the problem was that *GtkComboBox* is converted to a *ListBox* and not to a *ComboBox* when *"Has Entry"* is turned off in the .ui file.
All the best, Krisztian On 18 July 2014 16:17, Krisztian Pinter <pin.termina...@gmail.com> wrote: > Hi All! > > I have realized that one problem is that in the old style I was calling > the ctor of the *ComboBox* directly, and was able to set *WinBits* flags: > *aPaletteComboBox( this, WinBits( WB_BORDER | WB_DROPDOWN | WB_AUTOSIZE) > ),* > > However, now I use *VclBuilder::get*, and I can't do this. I tried > setting the flags after construction > *mpPaletteComboBox->SetStyle( WinBits(WB_BORDER | WB_DROPDOWN | > WB_AUTOSIZE) );* > but I think these flags affect the object construction itself, so by that > point, it's too late. > > *WB_DROPDOWN* is key here, because if it's not set, *mpFloatWin* won't be > initialized. > > I tried looking in Glade, to see if I can set these flags there, but I > couldn't find anything. > > All the best, > Krisztian > > > On 18 July 2014 14:37, Krisztian Pinter <pin.termina...@gmail.com> wrote: > >> Hi All! >> >> I'm working on converting the palette popup window (*SvxColorWindow_Impl*, >> looks like this in my branch right now: http://i.imgur.com/4XAbRaH.png) >> to use the widget layout, and I kind of got it working. It places the >> widgets based on a .ui file, but a *ComboBox* makes LO crash at the >> slightest provocation. >> >> To make *SvxColorWindow_Impl* use the widget layout, I did some >> research, and I drew this inheritance diagram: >> http://i.imgur.com/KK2GegK.jpg >> I made *FloatingWindow* also inherit from *VclBuilderContainer*, like >> *Dialog*, and added new ctors to *FloatingWindow* and *SfxPopupWindow*, >> that take two extra string parameters for the .ui file location and the id >> of the root widget. >> I hardcoded the .ui path for *SvxColorWindow_Impl* in its ctor, since >> it's supposed to be a leaf in the inheritance tree. >> I also copypasted *GetOptimalSize*, *SetPosSizePixel*, *SetSizePixel* >> and *SetPosPixel* from *TabPage* to *FloatingWindow*. >> This made the popup window show up, if I disabled parts of the code that >> called methods on the *ComboBox*. >> >> The *ComboBox* is initialized with *get*, as all other widgets. >> I found that *mpFloatWin* in *ComboBox* gets set to *0xcccccccccccccccc*, >> so I think it's not initialized properly. (I'm giving *get* the correct >> id from the .ui, so that's not it.) >> If I call either *AdaptDropDownLineCountToMaximu**m* or *InsertEntry* in >> the ctor of *SvxColorWindow_Impl*, LO crashes immediately when the popup >> window is opened. >> Are there any well known/typical reasons why this would happen? >> >> If anyone has any insights, please share them! Thank you! >> >> All the best, >> Krisztian >> > >
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice